This commit is contained in:
Cadey Ratio 2019-09-12 22:56:43 +00:00
parent a6a874b6a8
commit e4d7c3c269
2 changed files with 14 additions and 13 deletions

View File

@ -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()
}

View File

@ -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