Remove a bunch of unused cruft

This commit is contained in:
James Mills
2022-10-05 11:11:40 +10:00
parent 06c8ce3410
commit a07f747eb1
25 changed files with 31 additions and 1542 deletions

View File

@@ -10,7 +10,6 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/gomarkdown/markdown"
@@ -20,6 +19,8 @@ import (
"github.com/julienschmidt/httprouter"
sync "github.com/sasha-s/go-deadlock"
log "github.com/sirupsen/logrus"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
const pagesDir = "pages"
@@ -104,6 +105,8 @@ func (s *Server) PageHandler(name string) httprouter.Handle {
return page, nil
}
caser := cases.Title(language.English)
return func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
ctx := NewContext(s.config, s.db, r)
@@ -157,7 +160,7 @@ func (s *Server) PageHandler(name string) httprouter.Handle {
if frontmatter.Title != "" {
title = frontmatter.Title
} else {
title = strings.Title(name)
title = caser.String(name)
}
ctx.Title = title
ctx.Meta.Description = frontmatter.Description