more seo
This commit is contained in:
parent
c446e37bdc
commit
5e40156c92
|
@ -1,6 +1,5 @@
|
||||||
{{- $firstH1 := partial "name.html" . }}
|
{{- $firstH1 := partial "name.html" . }}
|
||||||
{{- $title := or .Title $firstH1 $.File.ContentBaseName }}
|
{{- $title := or .Title $firstH1 $.File.ContentBaseName }}
|
||||||
{{- $name := or .Params.name (print $title " - " .Site.Title) }}
|
|
||||||
|
|
||||||
{{- $cover := ($.Resources.ByType "image").GetMatch "{*cover*,*thumbnail*,*featured*}" -}}
|
{{- $cover := ($.Resources.ByType "image").GetMatch "{*cover*,*thumbnail*,*featured*}" -}}
|
||||||
{{ $icon := resources.GetMatch (default "" .Site.Params.icon) -}}
|
{{ $icon := resources.GetMatch (default "" .Site.Params.icon) -}}
|
||||||
|
@ -11,11 +10,13 @@
|
||||||
<meta name="application-name" property="og:site_name" content="{{ . }}" />
|
<meta name="application-name" property="og:site_name" content="{{ . }}" />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if .IsHome}}
|
{{- if .IsHome}}
|
||||||
{{- $name = or .Params.name .Site.Title }}
|
{{- with or .Params.name .Site.Title }}
|
||||||
{{- end }}
|
|
||||||
{{- with $name }}
|
|
||||||
<title>{{ . }}</title>
|
<title>{{ . }}</title>
|
||||||
<meta property="og:title" name="twitter:title" itemprop="name" content="{{ . }}" />
|
<meta property="og:title" name="twitter:title" itemprop="name" content="{{ . }}" />
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
<title>{{ or .Params.name (print $title " - " .Site.Title) }}</title>
|
||||||
|
<meta property="og:title" name="twitter:title" itemprop="name" content="{{ or .Params.name $title }}" />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*=== description ===*/}}
|
{{/*=== description ===*/}}
|
||||||
|
@ -51,15 +52,13 @@
|
||||||
<meta name="twitter:image:src" content="{{ $staticIcon }}" />
|
<meta name="twitter:image:src" content="{{ $staticIcon }}" />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*=== author ===*/}}
|
{{/*=== article ===*/}}
|
||||||
{{ with or .Params.author .Site.Params.author -}}
|
{{ with or .Params.author .Site.Params.author -}}
|
||||||
{{ "<!-- author -->" | safeHTML }}
|
{{ "<!-- author -->" | safeHTML }}
|
||||||
<meta name="author" property="article:author" content="{{ . }}" />
|
<meta name="author" property="article:author" content="{{ . }}" />
|
||||||
{{- end -}}
|
{{- end }}
|
||||||
<meta property="article:publisher" content="{{ .Site.BaseURL }}" />
|
<meta property="article:publisher" content="{{ .Site.BaseURL }}" />
|
||||||
|
{{ "<!-- time -->" | safeHTML }}
|
||||||
{{/*=== published and updated ===*/}}
|
|
||||||
{{- "<!-- time -->" | safeHTML }}
|
|
||||||
{{ with .Date -}}
|
{{ with .Date -}}
|
||||||
<meta property="article:published_time" itemprop="datePublished" content={{ .Format "2006-01-02T03:04:05Z" | safeHTML }} />
|
<meta property="article:published_time" itemprop="datePublished" content={{ .Format "2006-01-02T03:04:05Z" | safeHTML }} />
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
@ -68,7 +67,7 @@
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{/*=== section and keywords ===*/}}
|
{{/*=== section and keywords ===*/}}
|
||||||
{{- "<!-- keywords -->" | safeHTML -}}
|
{{- "<!-- keywords -->" | safeHTML }}
|
||||||
{{ with.Params.category -}}
|
{{ with.Params.category -}}
|
||||||
<meta property="article:section" content="{{ . }}" />
|
<meta property="article:section" content="{{ . }}" />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Reference in a new issue