summaryrefslogtreecommitdiffstats
path: root/scripts/metadata_filter.lua
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-04-20 21:45:36 +0200
committerVolpeon <git@volpeon.ink>2021-04-20 21:45:36 +0200
commit269433c6f84ce631d38fd7ffaed04ed3f7c2bf4f (patch)
treedece94a7b29ef36c98d322b8439e41d171fde0a8 /scripts/metadata_filter.lua
parentUpdate (diff)
downloadvolpeon.ink-269433c6f84ce631d38fd7ffaed04ed3f7c2bf4f.tar.gz
volpeon.ink-269433c6f84ce631d38fd7ffaed04ed3f7c2bf4f.tar.bz2
volpeon.ink-269433c6f84ce631d38fd7ffaed04ed3f7c2bf4f.zip
Support project previews
Diffstat (limited to 'scripts/metadata_filter.lua')
-rw-r--r--scripts/metadata_filter.lua10
1 files changed, 7 insertions, 3 deletions
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)
260 260
261 meta.file_out = get_file_out(meta.rewrites, meta.content_dir, 261 meta.file_out = get_file_out(meta.rewrites, meta.content_dir,
262 meta.output_dir, meta.file_in) 262 meta.output_dir, meta.file_in)
263 if meta.relative_to == nil then 263 if meta.relative_to == nil then meta.relative_to = meta.file_in end
264 meta.relative_to = meta.file_in
265 end
266 meta.relative_to_out = get_file_out(meta.rewrites, meta.content_dir, 264 meta.relative_to_out = get_file_out(meta.rewrites, meta.content_dir,
267 meta.output_dir, meta.relative_to) 265 meta.output_dir, meta.relative_to)
268 266
269 meta.url = resolve_url(meta.site.url, meta.output_dir, meta.relative_to_out, 267 meta.url = resolve_url(meta.site.url, meta.output_dir, meta.relative_to_out,
270 meta.file_out) 268 meta.file_out)
269 if meta.preview ~= nil then
270 meta.preview = pandoc.utils.stringify(meta.preview)
271 meta.preview = meta.file_out:gsub("/index%.html$", "/" .. meta.preview)
272 meta.preview = resolve_url(meta.site.url, meta.output_dir,
273 meta.relative_to_out, meta.preview)
274 end
271 275
272 meta.date = format_date(meta.date) 276 meta.date = format_date(meta.date)
273 if meta.last_update ~= nil then 277 if meta.last_update ~= nil then