mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-01 22:42:45 +02:00
Merge branch 'master' of github.com:spf13/hugo
This commit is contained in:
@@ -50,18 +50,18 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
|
||||
<title>{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{ with .Site.LanguageCode }}<language>{{.}}</language>{{end}}
|
||||
{{ with .Site.Author.email }}<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}
|
||||
{{ with .Site.Author.email }}<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}
|
||||
{{ with .Site.Copyright }}<copyright>{{.}}</copyright>{{end}}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</lastBuildDate>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHtml }}</lastBuildDate>{{ end }}
|
||||
<atom:link href="{{.Url}}" rel="self" type="application/rss+xml" />
|
||||
{{ range first 15 .Data.Pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHtml }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
@@ -73,8 +73,8 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
|
||||
t.AddInternalTemplate("_default", "sitemap.xml", `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
{{ range .Data.Pages }}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>
|
||||
<lastmod>{{ safeHtml ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ with .Sitemap.ChangeFreq }}
|
||||
<loc>{{ .Permalink }}</loc>{{ if not .Date.IsZero }}
|
||||
<lastmod>{{ safeHtml ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}
|
||||
</url>
|
||||
@@ -126,7 +126,7 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>{{end}}`)
|
||||
|
||||
// Add SEO & Social metadata
|
||||
t.AddInternalTemplate("_default", "opengraph.html", `<meta property="og:title" content="{{ .Title }}" />
|
||||
t.AddInternalTemplate("", "opengraph.html", `<meta property="og:title" content="{{ .Title }}" />
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}" />
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
@@ -134,7 +134,7 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
|
||||
<meta property="og:image" content="{{ . }}" />
|
||||
{{ end }}{{ end }}
|
||||
|
||||
<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" }}"/>{{ with .Params.audio }}
|
||||
{{ if not .Date.IsZero }}<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHtml }}"/>{{ end }}{{ with .Params.audio }}
|
||||
<meta property="og:audio" content="{{ . }}" />{{ end }}{{ with .Params.locale }}
|
||||
<meta property="og:locale" content="{{ . }}" />{{ end }}{{ with .Site.Params.title }}
|
||||
<meta property="og:site_name" content="{{ . }}" />{{ end }}{{ with .Params.videos }}
|
||||
@@ -166,7 +166,7 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
|
||||
<!-- Facebook Page Admin ID for Domain Insights -->
|
||||
{{ with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}`)
|
||||
|
||||
t.AddInternalTemplate("_default", "twitter_cards.html", `{{ if .IsPage }}
|
||||
t.AddInternalTemplate("", "twitter_cards.html", `{{ if .IsPage }}
|
||||
{{ with .Params.images }}
|
||||
<!-- Twitter summary card with large image must be at least 280x150px -->
|
||||
<meta name="twitter:card" content="summary_large_image"/>
|
||||
@@ -184,17 +184,17 @@ func (t *GoHtmlTemplate) EmbedTemplates() {
|
||||
{{ with .twitter }}<meta name="twitter:creator" content="@{{ . }}"/>{{ end }}
|
||||
{{ end }}{{ end }}`)
|
||||
|
||||
t.AddInternalTemplate("_default", "google_news.html", `{{ if .IsPage }}{{ with .Params.news_keywords }}
|
||||
t.AddInternalTemplate("", "google_news.html", `{{ if .IsPage }}{{ with .Params.news_keywords }}
|
||||
<meta name="news_keywords" content="{{ range $i, $kw := first 10 . }}{{ if $i }},{{ end }}{{ $kw }}{{ end }}" />
|
||||
{{ end }}{{ end }}`)
|
||||
|
||||
t.AddInternalTemplate("_default", "schema.html", `{{ with .Site.Social.GooglePlus }}<link rel="publisher" href="{{ . }}"/>{{ end }}
|
||||
t.AddInternalTemplate("", "schema.html", `{{ with .Site.Social.GooglePlus }}<link rel="publisher" href="{{ . }}"/>{{ end }}
|
||||
<meta itemprop="name" content="{{ .Title }}">
|
||||
<meta itemprop="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}">
|
||||
|
||||
{{if .IsPage}}{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}{{ if ne (.PublishDate.Format $ISO8601) "0001-01-01T00:00:00+00:00" }}
|
||||
<meta itemprop="datePublished" content="{{ .PublishDate.Format $ISO8601 }}" />{{ end }}
|
||||
<meta itemprop="dateModified" content="{{ .Date.Format $ISO8601 }}" />
|
||||
{{if .IsPage}}{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}{{ if not .PublishDate.IsZero }}
|
||||
<meta itemprop="datePublished" content="{{ .PublishDate.Format $ISO8601 | safeHtml }}" />{{ end }}
|
||||
{{ if not .Date.IsZero }}<meta itemprop="dateModified" content="{{ .Date.Format $ISO8601 | safeHtml }}" />{{ end }}
|
||||
<meta itemprop="wordCount" content="{{ .WordCount }}">
|
||||
{{ with .Params.images }}{{ range first 6 . }}
|
||||
<meta itemprop="image" content="{{ . }}">
|
||||
|
Reference in New Issue
Block a user