Repo for my website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

68 lines
3.0 KiB

<!-- Default -->
<meta name="author"
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Author }}{{ . }} {{ end }}{{ end }}">
<meta name="description"
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Params.description | plainify }}{{ end }}" />
<meta name="keywords"
content="{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}" />
<meta name="robots" content="noodp" />
<!-- Og -->
<meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:type" content="{{ if .IsHome }}website{{ else }}article{{ end }}" />
<meta property="og:title"
content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Params.title | plainify }}{{- with .Params.Subtitle }} // {{ . }}{{ end }}{{ end }}" />
<meta property="og:description"
content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ .Params.description | plainify }}{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{- with .Params.cover }}
{{- $img := resources.Get . }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
<meta property="og:image" content="{{ $img.Permalink }}" />
<meta property="og:image:width" content="{{ $img.Width }}" />
<meta property="og:image:height" content="{{ $img.Height }}" />
{{- end }}
<!-- Article -->
<meta property="article:publisher" content="{{ .Site.BaseURL }}" />
<meta name="article:author"
content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Author }}{{ . }} {{ end }}{{ end }}">
{{- if isset .Params "date" }}
<meta property="article:published_time" content="{{ time .Date }}" />
{{- end }}
{{- if .GitInfo }}
<meta property="article:modified_time" content="{{ time .GitInfo.AuthorDate }}" />
{{- end }}
{{- range .Params.categories }}
<meta property="article:section" content="{{ . }}" />
{{- end }}
{{- range .Params.tags }}
<meta property="article:tag" content="{{ . }}" />
{{- end }}
<!-- Itemprops -->
{{- template "_internal/schema.html" . }}
<!-- Twitter cards -->
<meta name="twitter:card" content="summary_large_image" />
{{- if .Params.cover }}
{{- $img := resources.Get .Params.cover }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
<meta name="twitter:image" content="{{ $img.Permalink }}" />
<meta name="twitter:image:alt" content="{{ .Params.title | plainify }}" />
{{- end }}
<meta name="twitter:title"
content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Params.title | plainify }}{{- with .Params.Subtitle }} // {{ . }}{{ end }}{{ end }}" />
<meta name="twitter:description"
content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}" />
<meta name="twitter:url" content="{{ .Permalink }}" />
{{- with .Site.Social.twitter }}
<meta name="twitter:site" content="{{ . }}" />
{{- end }}
{{- with .Site.Author.twitter }}
<meta name="twitter:creator" content="{{ . }}" />
{{- end }}