Explore the blog
LifeLab
Personal
ML papers
Demos
Culture
Software
Archery
Show code
-- A notebook index; the public export can only see published pages.
local sections={
 {path="blog/lifelab",label="LifeLab"},
 {path="blog/personal",label="Personal"},
 {path="blog/ml-papers",label="ML papers"},
 {path="blog/demos",label="Demos"},
 {path="blog/culture",label="Culture"},
 {path="blog/software",label="Software"},
 {path="blog/archery",label="Archery"},
}
local sections_ui={}
for _,section in ipairs(sections) do
 local result=nb.get_pages({search=section.path,limit=200,paginated=true})
 assert(result.total<=200,"Index needs pagination for "..section.path)
 local pages={}
 for _,page in ipairs(result.pages or {}) do
  if page.title:sub(1,#section.path+1)==section.path.."/" then pages[#pages+1]=page end
 end
 table.sort(pages,function(a,b)return a.title:lower()<b.title:lower() end)
 local links={}
 for _,page in ipairs(pages) do
  links[#links+1]=ui.page_link(page.title,page.title:sub(#section.path+2))
 end
 sections_ui[#sections_ui+1]=ui.collapsible(section.label,{open=false,children=ui.column(links,{appearance={gap=1}})})
end
ui.column(sections_ui,{appearance={gap=2}})

Sub-pages