diff --git a/main.go b/main.go index 3d24120..40e161f 100644 --- a/main.go +++ b/main.go @@ -89,7 +89,6 @@ func serveBlogPage() http.HandlerFunc { func serveBlogArticle() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - tracker.Hit(r) vars := mux.Vars(r) slug := strings.Split(vars["slug"], "-") @@ -105,6 +104,9 @@ func serveBlogArticle() http.HandlerFunc { return } + // track the hit if the article was found, otherwise we don't care + tracker.Hit(r) + tplCache.Render(w, "article.html", struct { Title string Content template.HTML diff --git a/static/style.css b/static/style.css index 16146b7..15f51e8 100644 --- a/static/style.css +++ b/static/style.css @@ -73,6 +73,12 @@ p { line-height: 1.5; } +img { + display: block; + margin-left: auto; + margin-right: auto; +} + @media (max-width: 700px) { body { padding: 40px 20px 80px 20px;