Don't count hits on article that were not found, centered images.

This commit is contained in:
Marvin Blum
2020-07-03 01:05:43 +02:00
committed by Marvin Blum
parent 64a6399a15
commit 687a1a1616
2 changed files with 9 additions and 1 deletions

View File

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