Remove a bunch of unused cruft
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user