Fix infinite loop in artwork embed page

This commit is contained in:
VnPower
2024-02-13 17:22:20 +07:00
parent 88c1f14909
commit 9a1a2c23cb
2 changed files with 8 additions and 3 deletions
+4
View File
@@ -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]
},
}
}
+4 -3
View File
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html>
{{ url := stripEmbed(BaseURL) }}
<head>
<meta charset="UTF-8">
<title>{{ Title }}</title>
@@ -7,14 +8,14 @@
<meta property="og:type" content="article" />
<meta property="og:title" content="{{ Title }}" />
<meta property="og:description" content="{{ MetaDescription }}" />
<meta property="og:url" content="{{ BaseURL }}" />
<meta property="og:url" content="{{ url }}" />
<meta property="og:image" content="{{ MetaImage }}" />
<meta name="twitter:card" content="summary_large_image" />
</head>
<body>
<a href="{{ BaseURL }}">You should have been redirected, here is a link to the original post.</a>
<a href="{{ url }}">You should have been redirected, here is a link to the original post.</a>
<script type="text/javascript">
window.location.replace("{{ BaseURL }}")
window.location.replace("{{ url }}")
</script>
</body>
</html>