package templates import ( "context" "io" "time" "go.alanpearce.eu/website/internal/config" "go.alanpearce.eu/website/internal/content" ) func Unsafe(html string) templ.Component { return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) { _, err = io.WriteString(w, html) return }) } templ postDate(d time.Time, class string) { } templ PostPage(config *config.Config, post content.Post) { @Layout(config, PageSettings{ Title: post.Title, TitleAttrs: templ.Attributes{ "class": "p-author h-card", "rel": "author", }, BodyAttrs: templ.Attributes{ "class": "h-entry", }, Path: post.URL, }) {

{ post.Title }

Published: @postDate(post.Date, "dt-published") // one commit: not updated if len(post.Commits) > 1 { Last updated: @postDate(post.Commits[0].Date, "dt-updated") }

@post
Tags:
} }