hugo-theme-next/layouts/partials/head/meta.html

49 lines
1.7 KiB
HTML
Raw Normal View History

{{- if .P.darkmode }}
<meta name="theme-color" content="{{ .P.themeColor.dark }}" media="(prefers-color-scheme: dark)">
{{- else }}
<meta name="theme-color" content="{{ .P.themeColor.light }}" media="(prefers-color-scheme: light)">
{{- end }}
{{- if .P.googleSiteVerification }}
<meta name="google-site-verification" content="{{ .P.googleSiteVerification }}">
{{- end }}
{{- with .P.bingSiteVerification }}
<meta name="msvalidate.01" content="{{ . }}">
{{- end }}
{{- with .P.yandexSiteVerification }}
<meta name="yandex-verification" content="{{ . }}">
{{- end }}
{{- with .P.baiduSiteVerification }}
<meta name="baidu-site-verification" content="{{ . }}">
{{- end }}
{{- $lang := .Scratch.Get "lang" }}
{{- $P := .P }}
{{- $Page := .Page }}
{{- with $P.openGraph }}
{{- if .enable }}
<meta property="og:type" content="website">
<meta property="og:title" content="{{ $Page.Title }}">
<meta property="og:description" content="{{ default $P.description $Page.Description }}">
<meta property="og:image" content="{{ $P.customLogo.url }}">
<meta property="og:url" content="{{ $Page.Permalink }}">
<meta property="og:site_name" content="{{ default $Page.Title $Page.Site.Title }}">
<meta property="og:locale" content="{{ $lang }}">
<meta property="article:author" content="{{ default $P.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 }}