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