26 lines
525 B
Go

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