From fa5ac4040e8e2fc57bef5c598e1ceda4c2fc0a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Herg=C3=A8s?= Date: Sun, 5 Oct 2025 15:16:20 +0200 Subject: feat(backend): add noreferer on external link and move target blank --- backend/config.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backend/config.go') diff --git a/backend/config.go b/backend/config.go index 8c111ae..d6cf25a 100644 --- a/backend/config.go +++ b/backend/config.go @@ -1,9 +1,11 @@ package backend import ( + "html/template" "log/slog" "os" + "git.anhgelus.world/anhgelus/small-world/markdown" "github.com/pelletier/go-toml/v2" ) @@ -12,6 +14,10 @@ type Link struct { URL string `toml:"url"` } +func (l *Link) Render() template.HTML { + return markdown.RenderLink(l.Name, l.URL) +} + type Logo struct { Header string `toml:"header"` Favicon string `toml:"favicon"` -- cgit v1.2.3