diff options
author | Volpeon <git@volpeon.ink> | 2021-12-27 13:35:27 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-12-27 13:35:27 +0100 |
commit | 84dcb995a86e5fcd904bd31a692492768ddefdc1 (patch) | |
tree | bad21661fc64908c880474fdd9cbb5b3c9e674ba /scripts | |
parent | Added project (diff) | |
download | volpeon.ink-84dcb995a86e5fcd904bd31a692492768ddefdc1.tar.gz volpeon.ink-84dcb995a86e5fcd904bd31a692492768ddefdc1.tar.bz2 volpeon.ink-84dcb995a86e5fcd904bd31a692492768ddefdc1.zip |
Simplified thumbnails
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/metadata_filter.lua | 12 |
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 |
20 | end | 20 | end |
21 | 21 | ||
22 | function 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 | ||
29 | end | ||
30 | |||
22 | function format_date(date) | 31 | function 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 | ||