From 53c55c9a6b2e1dd7a40015fd8952b51986956929 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Mon, 9 Nov 2020 17:04:20 +0100 Subject: [PATCH] More meta tags --- config.go | 1 - templates/footer.gohtml | 2 +- templates/postheadmeta.gohtml | 26 ++++++++++++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/config.go b/config.go index 1ccb4d0..c6a48d7 100644 --- a/config.go +++ b/config.go @@ -188,7 +188,6 @@ func initConfig() error { viper.SetDefault("cache.enable", true) viper.SetDefault("cache.expiration", 600) viper.SetDefault("user.nick", "admin") - viper.SetDefault("user.name", "Admin") viper.SetDefault("user.password", "secret") viper.SetDefault("hooks.shell", "/bin/bash") viper.SetDefault("hugo.frontmatter", []*frontmatter{{Meta: "title", Parameter: "title"}, {Meta: "tags", Parameter: "tags"}}) diff --git a/templates/footer.gohtml b/templates/footer.gohtml index 24b4f85..ea62a2e 100644 --- a/templates/footer.gohtml +++ b/templates/footer.gohtml @@ -7,6 +7,6 @@ href="{{ $item.Link }}">{{ $item.Title }}{{ $first = false }} {{ end }} {{ end }} -

© {{ dateformat now "2006" }} {{ .Blog.Title }}

+

© {{ dateformat now "2006" }} {{ with user.Name }}{{ . }}{{ else }}{{ .Blog.Title }}{{ end }}

{{ end }} \ No newline at end of file diff --git a/templates/postheadmeta.gohtml b/templates/postheadmeta.gohtml index 376fe08..0e5dd1e 100644 --- a/templates/postheadmeta.gohtml +++ b/templates/postheadmeta.gohtml @@ -1,13 +1,27 @@ {{ define "postheadmeta" }} - - {{ $ISO8601 := "2006-01-02T15:04:05-07:00" }} - {{ if .Data.Published }} - + {{ with .Canonical }} + + {{ end }} - {{ if .Data.Updated }} - + {{ with title .Data }} + + + {{ end }} + {{ with summary .Data }} + + + + {{ end }} + {{ $ISO8601 := "2006-01-02T15:04:05-07:00" }} + {{ with .Data.Published }} + + {{ end }} + {{ with .Data.Updated }} + {{ end }} {{ range $key, $image := ps .Data "images" }} + + {{ end }} {{ end }} \ No newline at end of file