mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
parent
bffa2a2a98
commit
34e4742f0c
4 changed files with 21 additions and 9 deletions
|
@ -31,12 +31,16 @@ images=["siteimg1.jpg", "siteimg2.jpg"]
|
|||
|
||||
b.WithContent("mybundle/index.md", `---
|
||||
title: My Bundle
|
||||
date: 2021-02-26T18:02:00-01:00
|
||||
lastmod: 2021-05-22T19:25:00-01:00
|
||||
---
|
||||
`)
|
||||
|
||||
b.WithContent("mypage.md", `---
|
||||
title: My Page
|
||||
images: ["pageimg1.jpg", "pageimg2.jpg"]
|
||||
date: 2021-02-26T18:02:00+01:00
|
||||
lastmod: 2021-05-22T19:25:00+01:00
|
||||
---
|
||||
`)
|
||||
|
||||
|
@ -62,16 +66,24 @@ title: My Site
|
|||
<meta property="og:title" content="My Bundle" />
|
||||
<meta property="og:url" content="https://example.org/mybundle/" />
|
||||
<meta property="og:image" content="https://example.org/mybundle/featured-sunset.jpg"/>
|
||||
<meta property="article:published_time" content="2021-02-26T18:02:00-01:00" />
|
||||
<meta property="article:modified_time" content="2021-05-22T19:25:00-01:00" />
|
||||
<meta itemprop="name" content="My Bundle">
|
||||
<meta itemprop="image" content="https://example.org/mybundle/featured-sunset.jpg">
|
||||
<meta itemprop="datePublished" content="2021-02-26T18:02:00-01:00" />
|
||||
<meta itemprop="dateModified" content="2021-05-22T19:25:00-01:00" />
|
||||
|
||||
`)
|
||||
b.AssertFileContent("public/mypage/index.html", `
|
||||
<meta name="twitter:image" content="https://example.org/pageimg1.jpg"/>
|
||||
<meta property="og:image" content="https://example.org/pageimg1.jpg" />
|
||||
<meta property="og:image" content="https://example.org/pageimg2.jpg" />
|
||||
<meta property="article:published_time" content="2021-02-26T18:02:00+01:00" />
|
||||
<meta property="article:modified_time" content="2021-05-22T19:25:00+01:00" />
|
||||
<meta itemprop="image" content="https://example.org/pageimg1.jpg">
|
||||
<meta itemprop="image" content="https://example.org/pageimg2.jpg">
|
||||
<meta itemprop="image" content="https://example.org/pageimg2.jpg">
|
||||
<meta itemprop="datePublished" content="2021-02-26T18:02:00+01:00" />
|
||||
<meta itemprop="dateModified" content="2021-05-22T19:25:00+01:00" />
|
||||
`)
|
||||
b.AssertFileContent("public/mysite/index.html", `
|
||||
<meta name="twitter:image" content="https://example.org/siteimg1.jpg"/>
|
||||
|
|
8
tpl/tplimpl/embedded/templates.autogen.go
generated
8
tpl/tplimpl/embedded/templates.autogen.go
generated
|
@ -224,8 +224,8 @@ if (!doNotTrack) {
|
|||
{{- if .IsPage }}
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
<meta property="article:section" content="{{ .Section }}" />
|
||||
{{ with .PublishDate }}<meta property="article:published_time" content="{{ .Format $iso8601 }}" />{{ end }}
|
||||
{{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format $iso8601 }}" />{{ end }}
|
||||
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
||||
|
@ -408,8 +408,8 @@ if (!doNotTrack) {
|
|||
|
||||
{{- if .IsPage -}}
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
{{ with .PublishDate }}<meta itemprop="datePublished" content="{{ .Format $iso8601 }}" />{{ end}}
|
||||
{{ with .Lastmod }}<meta itemprop="dateModified" content="{{ .Format $iso8601 }}" />{{ end}}
|
||||
{{ with .PublishDate }}<meta itemprop="datePublished" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
|
||||
{{ with .Lastmod }}<meta itemprop="dateModified" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
|
||||
<meta itemprop="wordCount" content="{{ .WordCount }}">
|
||||
|
||||
{{- with $.Params.images -}}
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
{{- if .IsPage }}
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
<meta property="article:section" content="{{ .Section }}" />
|
||||
{{ with .PublishDate }}<meta property="article:published_time" content="{{ .Format $iso8601 }}" />{{ end }}
|
||||
{{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format $iso8601 }}" />{{ end }}
|
||||
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
{{- if .IsPage -}}
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
{{ with .PublishDate }}<meta itemprop="datePublished" content="{{ .Format $iso8601 }}" />{{ end}}
|
||||
{{ with .Lastmod }}<meta itemprop="dateModified" content="{{ .Format $iso8601 }}" />{{ end}}
|
||||
{{ with .PublishDate }}<meta itemprop="datePublished" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
|
||||
{{ with .Lastmod }}<meta itemprop="dateModified" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}}
|
||||
<meta itemprop="wordCount" content="{{ .WordCount }}">
|
||||
|
||||
{{- with $.Params.images -}}
|
||||
|
|
Loading…
Reference in a new issue