From e4d7c3c2691acad73d6240ff0c9b208273b95997 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Thu, 12 Sep 2019 22:56:43 +0000 Subject: [PATCH] oops --- cmd/site/html.go | 25 +++++++++++++------------ templates/blogpost.html | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cmd/site/html.go b/cmd/site/html.go index a1d5040..c91216c 100644 --- a/cmd/site/html.go +++ b/cmd/site/html.go @@ -175,19 +175,20 @@ func (s *Site) showPost(w http.ResponseWriter, r *http.Request) { const dateFormat = `2006-01-02` s.renderTemplatePage("blogpost.html", struct { - Title string - Link string - BodyHTML template.HTML - Date string - Series string - Tags string + Title string + Link string + BodyHTML template.HTML + Date string + Series, SeriesTag string + Tags string }{ - Title: p.Title, - Link: p.Link, - BodyHTML: p.BodyHTML, - Date: p.Date.Format(dateFormat), - Series: strings.ReplaceAll(p.Series, "-", ""), - Tags: tags, + Title: p.Title, + Link: p.Link, + BodyHTML: p.BodyHTML, + Date: p.Date.Format(dateFormat), + Series: p.Series, + SeriesTag: strings.ReplaceAll(p.Series, "-", ""), + Tags: tags, }).ServeHTTP(w, r) postView.With(prometheus.Labels{"base": filepath.Base(p.Link)}).Inc() } diff --git a/templates/blogpost.html b/templates/blogpost.html index 00cd399..c4953a9 100644 --- a/templates/blogpost.html +++ b/templates/blogpost.html @@ -99,7 +99,7 @@ function share_on_mastodon() { // Hashtags var hashtags = "#blogpost"; - {{ if ne .Series "" }}hashtags += " #{{ .Series }}";{{ end }} + {{ if ne .SeriesTag "" }}hashtags += " #{{ .SeriesTag }}";{{ end }} {{ if ne .Tags "" }}hashtags += "{{ .Tags }}";{{ end }} // Tagging users, such as offical accounts or the author of the post