From 84566a32b1b0cf4fa57bb9d5409ee794deceab7f Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 14 Nov 2021 12:46:40 +0100 Subject: Added redirect fallback template --- scripts/metadata_filter.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') 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 function process(global, parent, meta) meta.namespace = resolve_namespace(meta.namespace) meta.file_out = pandoc.utils.stringify(meta.file_out):gsub("^out", "") + meta.redirect = meta.url and true meta.url = meta.url and pandoc.utils.stringify(meta.url) meta.url = resolve_url(global.site.url, global.file_out, meta.url or meta.file_out) meta.title = (meta.title and pandoc.utils.stringify(meta.title)) or "" @@ -292,7 +293,7 @@ function process(global, parent, meta) meta.pages = process_pages(global, { parent = parent, meta = meta }, meta.list_order, meta.pages) meta.depth = (meta.pages and find_depth(meta.pages.all)) or "0" - meta.layout = prep_layout(meta.layout or resolve_layout(meta.depth)) + meta.layout = prep_layout(meta.layout or (meta.redirect and "redirect") or resolve_layout(meta.depth)) if meta.date then meta.date = format_date(meta.date) -- cgit v1.2.3-70-g09d2