Finish head attribute settings.
- Add open graph meta attribute (also with twitter card, google puls, facebook) - Split the modules with css, icon, open graph etc.
This commit is contained in:
33
layouts/partials/head/open_graph.html
Normal file
33
layouts/partials/head/open_graph.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{{- $Site := .Site -}}
|
||||
{{- $Params := .Site.Params -}}
|
||||
{{- $Page := .Page -}}
|
||||
{{- with .Site.Params.openGraph -}}
|
||||
{{- if .enable -}}
|
||||
{{- $langCode := replaceRE "-([a-z]+)" (upper (substr $Site.Language -3)) $Site.Language }}
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="{{ $Page.Title }}">
|
||||
<meta property="og:description" content="{{ default $Params.description $Page.Description }}">
|
||||
<meta property="og:image" content="{{ default $Params.customLogo.url }}">
|
||||
<meta property="og:url" content="{{ $Page.Permalink }}">
|
||||
<meta property="og:site_name" content="{{ $Site.Title }}">
|
||||
<meta property="og:locale" content="{{ $langCode }}">
|
||||
<meta property="article:author" content="{{ default $Params.author $Page.Params.Author }}">
|
||||
|
||||
{{- with .twitter -}}
|
||||
{{- range $attr, $val := . }}
|
||||
<meta name="twitter:{{ $attr }}" content="{{ $val }}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .googlePlus }}
|
||||
<link rel="publisher" href=" {{ . }}">
|
||||
{{- end -}}
|
||||
|
||||
{{- with .facebook -}}
|
||||
{{- range $attr, $val := . }}
|
||||
<meta property="fb:{{ $attr }}" content="{{ $val }}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user