fix it
This commit is contained in:
59
homepage/layouts/_partials/head.html
Normal file
59
homepage/layouts/_partials/head.html
Normal file
@@ -0,0 +1,59 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||||
<title>
|
||||
{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title
|
||||
site.Title }}{{ end }}
|
||||
</title>
|
||||
{{ with .Description | default .Site.Params.description }}<meta
|
||||
name="description"
|
||||
content="{{ . }}"
|
||||
/>{{ end }} {{/* Canonical URL */}}
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
|
||||
{{/* Open Graph */}}
|
||||
<meta property="og:title" content="{{ .Title }}" />
|
||||
{{ with .Description | default .Site.Params.description }}<meta
|
||||
property="og:description"
|
||||
content="{{ . }}"
|
||||
/>{{ end }}
|
||||
<meta
|
||||
property="og:type"
|
||||
content="{{ if .IsPage }}article{{ else }}website{{ end }}"
|
||||
/>
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
{{ with .Site.Params.ogImage }}<meta
|
||||
property="og:image"
|
||||
content="{{ . | absURL }}"
|
||||
/>{{ end }} {{/* Twitter Card */}}
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{ .Title }}" />
|
||||
{{ with .Description | default .Site.Params.description }}<meta
|
||||
name="twitter:description"
|
||||
content="{{ . }}"
|
||||
/>{{ end }} {{ with .Site.Params.twitterHandle }}<meta
|
||||
name="twitter:site"
|
||||
content="@{{ . }}"
|
||||
/>{{ end }} {{ with .Site.Params.ogImage }}<meta
|
||||
name="twitter:image"
|
||||
content="{{ . | absURL }}"
|
||||
/>{{ end }} {{/* RSS Feed */}} {{ with .OutputFormats.Get "rss" -}} {{ printf
|
||||
`<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type
|
||||
.Permalink site.Title | safeHTML }} {{ end }} {{/* JSON-LD Structured Data for
|
||||
Articles */}} {{ if .IsPage }}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
"headline": "{{ .Title }}",
|
||||
"url": "{{ .Permalink }}",
|
||||
"datePublished": "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}",
|
||||
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}"
|
||||
{{- with $.Description | default $.Site.Params.description }},
|
||||
"description": "{{ . }}"
|
||||
{{- end }}
|
||||
}
|
||||
</script>
|
||||
{{ end }} {{ partialCached "head/favicon.html" . }} {{ partialCached
|
||||
"head/css.html" . }}
|
||||
Reference in New Issue
Block a user