summaryrefslogtreecommitdiffstats
path: root/scripts/metadata.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/metadata.lua')
-rw-r--r--scripts/metadata.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/metadata.lua b/scripts/metadata.lua
index 5157677..afd0ca5 100644
--- a/scripts/metadata.lua
+++ b/scripts/metadata.lua
@@ -76,7 +76,7 @@ function process_pages(global, build, meta)
76 local pages_date_desc = pandoc.List() 76 local pages_date_desc = pandoc.List()
77 77
78 for id, p in pairs(meta.pages) do 78 for id, p in pairs(meta.pages) do
79 process(global, build, p) 79 process(global, build, p, meta)
80 80
81 if not p.unlisted then 81 if not p.unlisted then
82 pages_all:insert(id) 82 pages_all:insert(id)
@@ -126,7 +126,7 @@ function resolve_dates(meta)
126 meta.was_updated = meta.date and meta.last_update and meta.date.yyyy_mm_dd ~= meta.last_update.yyyy_mm_dd 126 meta.was_updated = meta.date and meta.last_update and meta.date.yyyy_mm_dd ~= meta.last_update.yyyy_mm_dd
127end 127end
128 128
129function process_base(build, meta) 129function process_base(build, meta, parent)
130 meta.namespace = prep_namespace(meta.namespace) 130 meta.namespace = prep_namespace(meta.namespace)
131 meta.file_out = utils.stringify(meta.file_out) 131 meta.file_out = utils.stringify(meta.file_out)
132 meta.unlisted = meta.unlisted or (meta.draft and build.mode ~= "dev") 132 meta.unlisted = meta.unlisted or (meta.draft and build.mode ~= "dev")
@@ -136,13 +136,15 @@ function process_base(build, meta)
136 meta.slug = slug(meta.title) 136 meta.slug = slug(meta.title)
137 meta.schema_type = meta.schema_type or "CreativeWork" 137 meta.schema_type = meta.schema_type or "CreativeWork"
138 meta.list_layout = prep_layout(meta.list_layout or "list") 138 meta.list_layout = prep_layout(meta.list_layout or "list")
139 meta.list_order = meta.list_order and utils.stringify(meta.list_order)
139 meta.position = meta.position and tonumber(utils.stringify(meta.position)) 140 meta.position = meta.position and tonumber(utils.stringify(meta.position))
140 meta.thumbnail = meta.thumbnail and make_absolute("thumbnail." .. utils.stringify(meta.thumbnail), meta.file_out) 141 meta.thumbnail = meta.thumbnail and make_absolute("thumbnail." .. utils.stringify(meta.thumbnail), meta.file_out)
141 meta.layout = prep_layout(meta.layout or (meta.redirect and "redirect") or resolve_layout(meta.depth)) 142 meta.layout = prep_layout(meta.layout or (meta.redirect and "redirect") or resolve_layout(meta.depth))
143 meta.show_date = parent and parent.list_order == "date_desc"
142end 144end
143 145
144function process(global, build, meta) 146function process(global, build, meta, parent)
145 process_base(build, meta) 147 process_base(build, meta, parent)
146 process_pages(global, build, meta) 148 process_pages(global, build, meta)
147 resolve_dates(meta) 149 resolve_dates(meta)
148end 150end