From 269433c6f84ce631d38fd7ffaed04ed3f7c2bf4f Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 20 Apr 2021 21:45:36 +0200 Subject: Support project previews --- scripts/metadata_filter.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts/metadata_filter.lua') diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index 499cf3e..21698bd 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua @@ -260,14 +260,18 @@ function Meta(meta) meta.file_out = get_file_out(meta.rewrites, meta.content_dir, meta.output_dir, meta.file_in) - if meta.relative_to == nil then - meta.relative_to = meta.file_in - end + if meta.relative_to == nil then meta.relative_to = meta.file_in end meta.relative_to_out = get_file_out(meta.rewrites, meta.content_dir, meta.output_dir, meta.relative_to) meta.url = resolve_url(meta.site.url, meta.output_dir, meta.relative_to_out, meta.file_out) + if meta.preview ~= nil then + meta.preview = pandoc.utils.stringify(meta.preview) + meta.preview = meta.file_out:gsub("/index%.html$", "/" .. meta.preview) + meta.preview = resolve_url(meta.site.url, meta.output_dir, + meta.relative_to_out, meta.preview) + end meta.date = format_date(meta.date) if meta.last_update ~= nil then -- cgit v1.2.3-54-g00ecf