diff options
author | Volpeon <git@volpeon.ink> | 2021-12-17 16:52:55 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-12-17 16:52:55 +0100 |
commit | 6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09 (patch) | |
tree | 5446f244ccc93799f31e04c0c32a971e8a9155dd | |
parent | Improved 'items omitted' link (diff) | |
download | volpeon.ink-6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09.tar.gz volpeon.ink-6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09.tar.bz2 volpeon.ink-6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09.zip |
Fix external URLs in subpages
-rw-r--r-- | scripts/subpages.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/subpages.lua b/scripts/subpages.lua index 95f68f5..d77759d 100644 --- a/scripts/subpages.lua +++ b/scripts/subpages.lua | |||
@@ -9,13 +9,15 @@ function meta(meta) | |||
9 | end | 9 | end |
10 | 10 | ||
11 | function image(el) | 11 | function image(el) |
12 | if path.is_relative(el.src) then el.src = siteUrl .. path.join({ namespace, el.src }) end | 12 | if path.is_relative(el.src) and not el.src:match("^https?://") then |
13 | el.src = siteUrl .. path.join({ namespace, el.src }) | ||
14 | end | ||
13 | 15 | ||
14 | return el | 16 | return el |
15 | end | 17 | end |
16 | 18 | ||
17 | function link(el) | 19 | function link(el) |
18 | if path.is_relative(el.target) then | 20 | if path.is_relative(el.target) and not el.target:match("^https?://") then |
19 | el.target = siteUrl .. path.join({ namespace, el.target }) | 21 | el.target = siteUrl .. path.join({ namespace, el.target }) |
20 | end | 22 | end |
21 | 23 | ||