summaryrefslogtreecommitdiff
path: root/internal/generator/favicon.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-25 22:13:32 +0300
committerPaul Buetow <paul@buetow.org>2026-04-25 22:13:32 +0300
commita5cb9f7ad4b2bcb7ac367854147f661ab83c5ec1 (patch)
tree96db490ed72dec49c4bc2aba8539fd57f3246f47 /internal/generator/favicon.go
parentcc9c69ce748416ad1d9b28592ec463434023d63c (diff)
can swap themes dynamicallyv0.12.0
Diffstat (limited to 'internal/generator/favicon.go')
-rw-r--r--internal/generator/favicon.go27
1 files changed, 2 insertions, 25 deletions
diff --git a/internal/generator/favicon.go b/internal/generator/favicon.go
index a4a8251..8664183 100644
--- a/internal/generator/favicon.go
+++ b/internal/generator/favicon.go
@@ -6,35 +6,12 @@ import (
"fmt"
"image"
"image/color"
- "log"
"os"
"path/filepath"
- "strings"
-
- "codeberg.org/snonux/snonux/internal/generator/templates"
)
-// faviconHeadHTML is the <link rel="icon"> fragment injected into every theme's
-// <head>. Loaded at startup from the embedded templates FS so no HTML lives in
-// the Go sources.
-var faviconHeadHTML = loadFaviconHeadHTML()
-
-func loadFaviconHeadHTML() string {
- s, err := templates.Shared("favicon_head")
- if err != nil {
- log.Printf("warning: could not load favicon_head template: %v", err)
- return ""
- }
- return s
-}
-
-func injectSharedHead(theme string) string {
- if strings.Contains(theme, `rel="icon"`) {
- return theme
- }
-
- return strings.Replace(theme, "</head>", faviconHeadHTML+"</head>", 1)
-}
+// shell.tmpl now embeds the favicon <link> directly, so no head-injection
+// helper is needed; favicon.go only generates and writes the .ico binary.
func writeFavicon(outputDir string) error {
data, err := generateFaviconICO()