// templates/style.go package templates import ( "bytes" "fmt" ) // PageMetadata holds the frontmatter data type PageMetadata struct { Title string `toml:"title" yaml:"title"` Stylesheet string `toml:"stylesheet" yaml:"stylesheet"` Style string `toml:"style" yaml:"style"` // Inline CSS } // BuildFullPage wraps the content in the HTML shell, injecting metadata. func BuildFullPage(content []byte, meta PageMetadata) []byte { var buf bytes.Buffer // Default title if missing title := meta.Title if title == "" { title = "Blog" } // Default stylesheet if missing cssLink := `` if meta.Stylesheet != "" { cssLink = fmt.Sprintf(``, meta.Stylesheet) } buf.WriteString(`