summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-12-17 16:52:55 +0100
committerVolpeon <git@volpeon.ink>2021-12-17 16:52:55 +0100
commit6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09 (patch)
tree5446f244ccc93799f31e04c0c32a971e8a9155dd
parentImproved 'items omitted' link (diff)
downloadvolpeon.ink-6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09.tar.gz
volpeon.ink-6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09.tar.bz2
volpeon.ink-6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09.zip
Fix external URLs in subpages
-rw-r--r--scripts/subpages.lua6
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)
9end 9end
10 10
11function image(el) 11function 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
15end 17end
16 18
17function link(el) 19function 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