fix missing doctype (swallowed by htmlformat)
1 file changed, 11 insertions(+), 1 deletion(-)
changed files
M templates/layout.go → templates/layout.go
@@ -42,7 +42,7 @@ }) } func Layout(site SiteSettings, page PageSettings, children ...g.Node) g.Node { - return FormattedDocument(Doctype( + return DoctypeHTML(FormattedDocument( HTML( Lang(site.Language), Head(@@ -124,3 +124,13 @@ return nil }) } + +func DoctypeHTML(sibling g.Node) g.Node { + return g.NodeFunc(func(w io.Writer) error { + if _, err := w.Write([]byte("<!doctype html>\n")); err != nil { + return err + } + + return sibling.Render(w) + }) +}