diff --git a/go.mod b/go.mod index 2dcc387..3a67bc3 100644 --- a/go.mod +++ b/go.mod @@ -55,7 +55,7 @@ require ( github.com/yuin/goldmark-emoji v1.0.2-0.20210607094911-0487583eca38 github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01 golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 - golang.org/x/net v0.0.0-20211216030914-fe4d6282115f + golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/text v0.3.7 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b diff --git a/go.sum b/go.sum index ff2a31d..72c1b64 100644 --- a/go.sum +++ b/go.sum @@ -533,8 +533,8 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d h1:62NvYBuaanGXR2ZOfwDFkhhl6X1DUgf8qg3GuQvxZsE= +golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/render.go b/render.go index 3a1b384..77a42c8 100644 --- a/render.go +++ b/render.go @@ -63,6 +63,12 @@ func (a *goBlog) initRendering() error { "liketitle": a.likeTitle, "photolinks": a.photoLinks, "gettrack": a.getTrack, + // Code based rendering + "posttax": a.renderPostTax, + "oldcontentwarning": a.renderOldContentWarning, + "interactions": a.renderInteractions, + "author": a.renderAuthor, + "tor": a.renderTorNotice, // Others "dateformat": dateFormat, "isodate": isoDateFormat, @@ -72,9 +78,7 @@ func (a *goBlog) initRendering() error { "string": a.ts.GetTemplateStringVariantFunc(), "include": a.includeRenderedTemplate, "urlize": urlize, - "sort": sortedStrings, "absolute": a.getFullAddress, - "mentions": a.db.getWebmentionsByAddress, "geotitle": a.geoTitle, "geolink": geoOSMLink, "opensearch": openSearchUrl, diff --git a/templateAssets.go b/templateAssets.go index 1bb272e..dba9efc 100644 --- a/templateAssets.go +++ b/templateAssets.go @@ -21,10 +21,10 @@ type assetFile struct { body []byte } -func (a *goBlog) initTemplateAssets() (err error) { +func (a *goBlog) initTemplateAssets() error { a.assetFileNames = map[string]string{} a.assetFiles = map[string]*assetFile{} - err = filepath.Walk(assetsFolder, func(path string, info os.FileInfo, err error) error { + if err := filepath.Walk(assetsFolder, func(path string, info os.FileInfo, err error) error { if info.Mode().IsRegular() { // Open file file, err := os.Open(path) @@ -43,13 +43,11 @@ func (a *goBlog) initTemplateAssets() (err error) { } } return nil - }) - if err != nil { + }); err != nil { return err } // Add syntax highlighting CSS - err = a.initChromaCSS() - if err != nil { + if err := a.initChromaCSS(); err != nil { return err } return nil diff --git a/templates/author.gohtml b/templates/author.gohtml deleted file mode 100644 index 722de35..0000000 --- a/templates/author.gohtml +++ /dev/null @@ -1,10 +0,0 @@ -{{ define "author" }} - {{ with .User }} -
- {{ end }} -{{ end }} \ No newline at end of file diff --git a/templates/base.gohtml b/templates/base.gohtml index 86cbf19..acfd63a 100644 --- a/templates/base.gohtml +++ b/templates/base.gohtml @@ -5,9 +5,7 @@ {{ with .Canonical }}{{ end }} - {{ block "title" . }} -{{ . }}
{{ end }} + {{ with index .Blog.Menus "main" }} + + {{ end }} + {{ if .LoggedIn }} + + {{ end }} +