summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-11-14 12:46:40 +0100
committerVolpeon <git@volpeon.ink>2021-11-14 12:46:40 +0100
commit84566a32b1b0cf4fa57bb9d5409ee794deceab7f (patch)
treee4a106bae2678d2173569cdf1c889a0544d02b06 /scripts
parentList generation: Handle empty subpages list better (diff)
downloadvolpeon.ink-84566a32b1b0cf4fa57bb9d5409ee794deceab7f.tar.gz
volpeon.ink-84566a32b1b0cf4fa57bb9d5409ee794deceab7f.tar.bz2
volpeon.ink-84566a32b1b0cf4fa57bb9d5409ee794deceab7f.zip
Added redirect fallback template
Diffstat (limited to 'scripts')
-rw-r--r--scripts/metadata_filter.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua
index 0ff7429..c7f4d4a 100644
--- a/scripts/metadata_filter.lua
+++ b/scripts/metadata_filter.lua
@@ -259,6 +259,7 @@ end
259function process(global, parent, meta) 259function process(global, parent, meta)
260 meta.namespace = resolve_namespace(meta.namespace) 260 meta.namespace = resolve_namespace(meta.namespace)
261 meta.file_out = pandoc.utils.stringify(meta.file_out):gsub("^out", "") 261 meta.file_out = pandoc.utils.stringify(meta.file_out):gsub("^out", "")
262 meta.redirect = meta.url and true
262 meta.url = meta.url and pandoc.utils.stringify(meta.url) 263 meta.url = meta.url and pandoc.utils.stringify(meta.url)
263 meta.url = resolve_url(global.site.url, global.file_out, meta.url or meta.file_out) 264 meta.url = resolve_url(global.site.url, global.file_out, meta.url or meta.file_out)
264 meta.title = (meta.title and pandoc.utils.stringify(meta.title)) or "" 265 meta.title = (meta.title and pandoc.utils.stringify(meta.title)) or ""
@@ -292,7 +293,7 @@ function process(global, parent, meta)
292 meta.pages = 293 meta.pages =
293 process_pages(global, { parent = parent, meta = meta }, meta.list_order, meta.pages) 294 process_pages(global, { parent = parent, meta = meta }, meta.list_order, meta.pages)
294 meta.depth = (meta.pages and find_depth(meta.pages.all)) or "0" 295 meta.depth = (meta.pages and find_depth(meta.pages.all)) or "0"
295 meta.layout = prep_layout(meta.layout or resolve_layout(meta.depth)) 296 meta.layout = prep_layout(meta.layout or (meta.redirect and "redirect") or resolve_layout(meta.depth))
296 297
297 if meta.date then 298 if meta.date then
298 meta.date = format_date(meta.date) 299 meta.date = format_date(meta.date)