diff --git a/page.go b/page.go index 34ba4bf..d574996 100644 --- a/page.go +++ b/page.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "log" pathpkg "path" "strings" @@ -54,6 +55,9 @@ func NewPage(path string, content []byte) *Page { if err := yaml.Unmarshal(frontmatter, &page); err != nil { log.Printf("failed to parse frontmatter for %q: %v", path, err) } + + // Trim leading newlines from content + content = bytes.TrimLeft(content, "\r\n") } // Remove extension from path