From 6db971e1cd91a1cc1e8d39f85aa423c1dc27eb09 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 17 Dec 2021 16:52:55 +0100 Subject: Fix external URLs in subpages --- scripts/subpages.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') 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) end function image(el) - if path.is_relative(el.src) then el.src = siteUrl .. path.join({ namespace, el.src }) end + if path.is_relative(el.src) and not el.src:match("^https?://") then + el.src = siteUrl .. path.join({ namespace, el.src }) + end return el end function link(el) - if path.is_relative(el.target) then + if path.is_relative(el.target) and not el.target:match("^https?://") then el.target = siteUrl .. path.join({ namespace, el.target }) end -- cgit v1.2.3-70-g09d2