From 9a1a2c23cba3aff58f30a7607cb40f2f04dae352 Mon Sep 17 00:00:00 2001 From: VnPower Date: Tue, 13 Feb 2024 17:22:20 +0700 Subject: [PATCH] Fix infinite loop in artwork embed page --- serve/template.go | 4 ++++ views/embed.jet.html | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/serve/template.go b/serve/template.go index 5c79e40..d91fb31 100644 --- a/serve/template.go +++ b/serve/template.go @@ -246,5 +246,9 @@ func GetTemplateFunctions() template.FuncMap { } return strings.Join(ids, ",") }, + "stripEmbed": func(s string) string { + // this is stupid + return s[:len(s)-6] + }, } } diff --git a/views/embed.jet.html b/views/embed.jet.html index cf19e72..3f2fdc0 100644 --- a/views/embed.jet.html +++ b/views/embed.jet.html @@ -1,5 +1,6 @@ + {{ url := stripEmbed(BaseURL) }} {{ Title }} @@ -7,14 +8,14 @@ - + - You should have been redirected, here is a link to the original post. + You should have been redirected, here is a link to the original post.