diff options
| -rw-r--r-- | layouts/partials/templates/opengraph.html | 3 | ||||
| -rw-r--r-- | layouts/partials/templates/schema.html | 3 | ||||
| -rw-r--r-- | layouts/partials/templates/twitter_cards.html | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 48ad5eb..834e3a1 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -8,7 +8,7 @@ {{- else}} <meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" /> {{- end}} -{{- end }} +{{- else }} {{ with $.Params.images }}{{ range first 6 . -}} <meta property="og:image" content="{{ . | absURL }}" /> {{ end }}{{ else -}} @@ -21,6 +21,7 @@ {{- with $.Site.Params.images -}} <meta property="og:image" content="{{ index . 0 | absURL }}"/> {{ end }}{{ end }}{{ end }} +{{- end }} {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} {{- if .IsPage }} diff --git a/layouts/partials/templates/schema.html b/layouts/partials/templates/schema.html index e01dc48..6c032b6 100644 --- a/layouts/partials/templates/schema.html +++ b/layouts/partials/templates/schema.html @@ -11,7 +11,7 @@ {{- else}} <meta itemprop="image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" /> {{- end}} -{{- end }} +{{- else }} {{ with $.Params.images }}{{ range first 6 . -}} <meta itemprop="image" content="{{ . | absURL }}"> {{ end }}{{ else -}} @@ -24,6 +24,7 @@ {{- with $.Site.Params.images -}} <meta itemprop="image" content="{{ index . 0 | absURL }}"/> {{ end }}{{ end }}{{ end }} +{{- end }} <!-- Output all taxonomies as schema.org keywords --> <meta itemprop="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" /> diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index 2b3b7c9..de86c78 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -5,7 +5,7 @@ {{- else }} <meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" /> {{- end}} -{{ end }} +{{- else }} {{- with $.Params.images -}} <meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:image" content="{{ index . 0 | absURL }}"/> @@ -25,6 +25,7 @@ {{- end -}} {{- end -}} {{- end }} +{{- end }} <meta name="twitter:title" content="{{ .Title }}"/> <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> {{ with .Site.Social.twitter -}} |
