26 lines
525 B
Go
Raw Permalink Normal View History

2025-01-21 14:00:40 +01:00
package app
import (
"fmt"
2025-03-05 15:36:32 +01:00
"html"
2025-01-21 14:00:40 +01:00
"strings"
)
var (
HTML string
CSS string
2025-03-05 15:36:32 +01:00
Icon string
2025-01-21 14:00:40 +01:00
Posts map[string]*Post
Projects []string
)
func init() {
HTML = loadClean("public/app.html")
CSS = loadClean("public/app.css")
2025-03-05 15:36:32 +01:00
Icon = loadClean("public/icon.svg")
2025-01-21 14:00:40 +01:00
HTML = strings.Replace(HTML, "{head}", fmt.Sprintf("{head}<style>%s</style>", CSS), 1)
2025-03-05 15:36:32 +01:00
HTML = strings.ReplaceAll(HTML, "{icon}", "data:image/svg+xml,"+html.EscapeString(Icon))
2025-01-21 14:00:40 +01:00
Posts = loadPosts("posts")
Projects = loadProjects("projects")
}