mirror of https://github.com/jlelse/GoBlog
More meta tags
This commit is contained in:
parent
5b9ac19cb8
commit
53c55c9a6b
|
@ -188,7 +188,6 @@ func initConfig() error {
|
||||||
viper.SetDefault("cache.enable", true)
|
viper.SetDefault("cache.enable", true)
|
||||||
viper.SetDefault("cache.expiration", 600)
|
viper.SetDefault("cache.expiration", 600)
|
||||||
viper.SetDefault("user.nick", "admin")
|
viper.SetDefault("user.nick", "admin")
|
||||||
viper.SetDefault("user.name", "Admin")
|
|
||||||
viper.SetDefault("user.password", "secret")
|
viper.SetDefault("user.password", "secret")
|
||||||
viper.SetDefault("hooks.shell", "/bin/bash")
|
viper.SetDefault("hooks.shell", "/bin/bash")
|
||||||
viper.SetDefault("hugo.frontmatter", []*frontmatter{{Meta: "title", Parameter: "title"}, {Meta: "tags", Parameter: "tags"}})
|
viper.SetDefault("hugo.frontmatter", []*frontmatter{{Meta: "title", Parameter: "title"}, {Meta: "tags", Parameter: "tags"}})
|
||||||
|
|
|
@ -7,6 +7,6 @@
|
||||||
href="{{ $item.Link }}">{{ $item.Title }}</a>{{ $first = false }}
|
href="{{ $item.Link }}">{{ $item.Title }}</a>{{ $first = false }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<p>© {{ dateformat now "2006" }} {{ .Blog.Title }}</p>
|
<p>© {{ dateformat now "2006" }} {{ with user.Name }}{{ . }}{{ else }}{{ .Blog.Title }}{{ end }}</p>
|
||||||
</footer>
|
</footer>
|
||||||
{{ end }}
|
{{ end }}
|
|
@ -1,13 +1,27 @@
|
||||||
{{ define "postheadmeta" }}
|
{{ define "postheadmeta" }}
|
||||||
<meta name="description" content="{{ with summary .Data }}{{ . }}{{ end }}">
|
{{ with .Canonical }}
|
||||||
{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
<meta property="og:url" content="{{ . }}">
|
||||||
{{ if .Data.Published }}
|
<meta property="twitter:url" content="{{ . }}">
|
||||||
<meta itemprop="datePublished" content="{{ dateformat .Data.Published $ISO8601 }}">
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .Data.Updated }}
|
{{ with title .Data }}
|
||||||
<meta itemprop="dateModified" content="{{ dateformat .Data.Updated $ISO8601 }}">
|
<meta property="og:title" content="{{ . }}">
|
||||||
|
<meta property="twitter:title" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ with summary .Data }}
|
||||||
|
<meta name="description" content="{{ . }}">
|
||||||
|
<meta property="og:description" content="{{ . }}">
|
||||||
|
<meta property="twitter:description" content="{{ . }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
||||||
|
{{ with .Data.Published }}
|
||||||
|
<meta itemprop="datePublished" content="{{ dateformat . $ISO8601 }}">
|
||||||
|
{{ end }}
|
||||||
|
{{ with .Data.Updated }}
|
||||||
|
<meta itemprop="dateModified" content="{{ dateformat . $ISO8601 }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ range $key, $image := ps .Data "images" }}
|
{{ range $key, $image := ps .Data "images" }}
|
||||||
<meta itemprop="image" content="{{ $image }}">
|
<meta itemprop="image" content="{{ $image }}">
|
||||||
|
<meta property="og:image" content="{{ $image }}">
|
||||||
|
<meta property="twitter:image" content="{{ $image }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
Loading…
Reference in New Issue