summaryrefslogtreecommitdiffstats
path: root/scripts/page.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/page.lua')
-rw-r--r--scripts/page.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/page.lua b/scripts/page.lua
index 4eeebb2..f3802a2 100644
--- a/scripts/page.lua
+++ b/scripts/page.lua
@@ -79,7 +79,8 @@ function cat_to_list_cat(meta, allItems)
79 79
80 return { 80 return {
81 title = meta.title, 81 title = meta.title,
82 description = meta.description, 82 description = (meta.description and pandoc.MetaBlocks(pandoc.Para(meta.description))) or
83 (not meta.no_description and meta.content),
83 last_update = meta.last_update, 84 last_update = meta.last_update,
84 schema_type = meta.schema_type, 85 schema_type = meta.schema_type,
85 url = meta.url, 86 url = meta.url,
@@ -191,23 +192,22 @@ function process(global, build, meta, dir)
191 end 192 end
192end 193end
193 194
194function prune_pages(meta, n) 195function prune_pages(meta, up, down)
195 if n == 0 then 196 meta.pages.random = pandoc.List()
196 meta.pages = { 197 meta.pages.by_id = {}
197 all = pandoc.List(), 198
198 date_desc = pandoc.List(), 199 if down == 0 then
199 random = pandoc.List(), 200 meta.pages.all = pandoc.List()
200 by_id = {} 201 meta.pages.date_desc = pandoc.List()
201 }
202 else 202 else
203 for _, p in pairs(meta.pages.by_id) do 203 for _, p in pairs(meta.pages.by_id) do
204 prune_pages(p, n - 1) 204 prune(p, up, down - 1)
205 end 205 end
206 end 206 end
207end 207end
208 208
209function prune(meta, up, down) 209function prune(meta, up, down)
210 prune_pages(meta, down) 210 prune_pages(meta, up, down)
211 211
212 if up == 0 then 212 if up == 0 then
213 meta.parent = nil 213 meta.parent = nil