aboutsummaryrefslogtreecommitdiff
path: root/backend/config.go
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-10-05 15:16:20 +0200
committerWilliam Hergès <william@herges.fr>2025-10-05 15:16:20 +0200
commitfa5ac4040e8e2fc57bef5c598e1ceda4c2fc0a73 (patch)
tree5dbbba0ec6101fb666ee88a977a21ef95d55a2e9 /backend/config.go
parent5d6198f168dd1a8598048718d149d1171df09c1a (diff)
feat(backend): add noreferer on external link and move target blank
Diffstat (limited to 'backend/config.go')
-rw-r--r--backend/config.go6
1 files changed, 6 insertions, 0 deletions
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"`