~erock/pico

0515a612f9cd7fec41f4d1befac9a29b297aa1c8 — Eric Bower a month ago 893485f
feat: tag posts with slug as classname on body

This will make it easier to do per post style changes.
2 files changed, 3 insertions(+), 1 deletions(-)

M prose/api.go
M prose/html/post.page.tmpl
M prose/api.go => prose/api.go +2 -0
@@ 62,6 62,7 @@ type PostPageData struct {
	PageTitle    string
	URL          template.URL
	BlogURL      template.URL
	Slug         string
	Title        string
	Description  string
	Username     string


@@ 354,6 355,7 @@ func postHandler(w http.ResponseWriter, r *http.Request) {
			BlogURL:      template.URL(cfg.FullBlogURL(username, onSubdomain, withUserName)),
			Description:  post.Description,
			Title:        shared.FilenameToTitle(post.Filename, post.Title),
			Slug:         post.Slug,
			PublishAt:    post.PublishAt.Format("02 Jan, 2006"),
			PublishAtISO: post.PublishAt.Format(time.RFC3339),
			Username:     username,

M prose/html/post.page.tmpl => prose/html/post.page.tmpl +1 -1
@@ 26,7 26,7 @@
{{if .HasCSS}}<link rel="stylesheet" href="{{.CssURL}}" />{{end}}
{{end}}

{{define "attrs"}}id="post"{{end}}
{{define "attrs"}}id="post" class="{{.Slug}}"{{end}}

{{define "body"}}
<header>