summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/metadata_filter.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua
index b16ab92..413ded5 100644
--- a/scripts/metadata_filter.lua
+++ b/scripts/metadata_filter.lua
@@ -19,6 +19,15 @@ function pandoc.List:take(n)
19 return result 19 return result
20end 20end
21 21
22function file_exists(name)
23 local f = io.open(name, "r")
24 if f ~= nil then
25 io.close(f)
26 return true
27 end
28 return false
29end
30
22function format_date(date) 31function format_date(date)
23 if not date then return date end 32 if not date then return date end
24 33
@@ -297,7 +306,8 @@ function process(global, meta)
297 end 306 end
298 307
299 if meta.thumbnail then 308 if meta.thumbnail then
300 meta.thumbnail = make_absolute(pandoc.utils.stringify(meta.thumbnail), meta.file_out) 309 meta.thumbnail = make_absolute("thumbnail." .. pandoc.utils.stringify(meta.thumbnail),
310 meta.file_out)
301 meta.thumbnail = resolve_url(global.site.url, global.file_out, meta.thumbnail) 311 meta.thumbnail = resolve_url(global.site.url, global.file_out, meta.thumbnail)
302 end 312 end
303 313