Update head.html

This commit is contained in:
willstocks 2020-03-10 12:03:11 +00:00 committed by GitHub
parent 0dc364f3e2
commit 6ef1bb1686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,11 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <meta name="viewport"
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}"/> content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="keywords" content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}"/> <meta name="description"
<meta name="robots" content="noodp"/> content="{{ if .IsHome }}{{ .Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
<meta name="keywords"
content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}" />
<meta name="robots" content="noodp" />
<link rel="canonical" href="{{ .Permalink }}" /> <link rel="canonical" href="{{ .Permalink }}" />
{{ template "_internal/google_analytics.html" . }} {{ template "_internal/google_analytics.html" . }}
@ -10,12 +13,13 @@
<!-- Theme CSS --> <!-- Theme CSS -->
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}"> <link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
{{ if (ne $.Site.Params.ThemeColor "orange") }} {{ if (ne $.Site.Params.ThemeColor "orange") }}
<link rel="stylesheet" href="{{ (printf "assets/%s.css" $.Site.Params.ThemeColor) | absURL }}"> <link rel="stylesheet"
href="{{ (printf "assets/%s.css" $.Site.Params.ThemeColor) | absURL }}">
{{ end }} {{ end }}
<!-- Custom CSS to override theme properties (/static/style.css) --> <!-- Custom CSS to override theme properties (/static/style.css) -->
{{ if (fileExists "static/style.css") -}} {{ if (fileExists "static/style.css") -}}
<link rel="stylesheet" href="{{ "style.css" | absURL }}"> <link rel="stylesheet" href="{{ "style.css" | absURL }}">
{{- end }} {{- end }}
<!-- Icons --> <!-- Icons -->
@ -23,38 +27,58 @@
{{ if isset $.Site.Params "favicon" }} {{ if isset $.Site.Params "favicon" }}
<link rel="shortcut icon" href="{{ $.Site.Params.favicon | absURL }}"> <link rel="shortcut icon" href="{{ $.Site.Params.favicon | absURL }}">
{{ else }} {{ else }}
<link rel="shortcut icon" href="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}"> <link rel="shortcut icon"
href="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}">
{{ end }} {{ end }}
<!-- Twitter Card --> <!-- Twitter Card -->
<meta name="twitter:card" content="summary" /> <meta name="twitter:card"
<meta name="twitter:title" content="{{ if .IsHome }}{{ $.Site.Title }} — {{ $.Site.Params.Subtitle }}{{ else }}{{ .Title }} :: {{ $.Site.Title }} — {{ $.Site.Params.Subtitle }}{{ end }}" /> content="summary" />
<meta name="twitter:description" content="{{ if .IsHome }}{{ $.Site.Params.tagline }}{{ else }}{{ .Summary | plainify }}{{ end }}" /> <meta name="twitter:title"
<meta name="twitter:site" content="{{ $.Site.BaseURL }}" /> content="{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} :: {{ $.Site.Title }} {{ end }}" />
<meta name="twitter:creator" content="{{ .Params.Author }}" /> <meta name="twitter:description"
<meta name="twitter:image" content="{{ with .Params.Cover }}{{ . | absURL }}{{ end }}"> content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
<meta name="twitter:site"
content="{{ .Permalink }}" />
<meta name="twitter:creator"
content="{{ if .IsHome }}{{ $.Site.Owner }}{{ else }}{{ .Params.Author }}{{ end }}" />
<meta name="twitter:image"
content="{{ if .IsHome }}{{ $.Site.Params.favicon | absURL }}{{else}}{{ with .Params.Cover }}{{ . | absURL }}{{ end }}">
<!-- OG data --> <!-- OG data -->
<meta property="og:locale" content="{{ $.Site.Language.Lang }}" /> <meta property="og:locale"
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> content="{{ $.Site.Language.Lang }}" />
<meta property="og:title" content="{{ if .IsHome }}{{ $.Site.Title }} — {{ $.Site.Params.Subtitle }}{{ else }}{{ .Title }} :: {{ $.Site.Title }} — {{ $.Site.Params.Subtitle }}{{ end }}"> <meta property="og:type"
<meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.tagline }}{{ else }}{{ .Summary | plainify }}{{ end }}" /> content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:title"
<meta property="og:site_name" content="{{ .Title }}" /> content="{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} :: {{ $.Site.Title }}{{ end }}">
<meta property="og:image" content="{{ with .Params.Cover }}{{ . | absURL }}{{ end }}"> <meta property="og:description"
<meta property="og:image:width" content="2048"> content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
<meta property="og:image:height" content="1024"> <meta property="og:url"
{{ range .Params.categories }}<meta property="article:section" content="{{ . }}" />{{ end }} content="{{ .Permalink }}" />
{{ if isset .Params "date" }}<meta property="article:published_time" content="{{ time .Date }}" />{{ end }} <meta property="og:site_name"
content="{{ .Title }}" />
<meta property="og:image"
content="{{ if .IsHome }}{{ $.Site.Params.favicon | absURL }}{{else}}{{ with .Params.Cover }}{{ . | absURL }}{{ end }}">
<meta property="og:image:width"
content="2048">
<meta property="og:image:height"
content="1024">
{{ range .Params.categories }}
<meta property="article:section" content="{{ . }}" />{{ end }}
{{ if isset .Params "date" }}
<meta property="article:published_time" content="{{ time .Date }}" />{{ end }}
<!-- RSS --> <!-- RSS -->
{{ with .OutputFormats.Get "RSS" }} {{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" /> <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml"
title="{{ $.Site.Title }}" />
{{ end }} {{ end }}
<!-- JSON Feed --> <!-- JSON Feed -->
{{ with .OutputFormats.Get "json" }} {{ with .OutputFormats.Get "json" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/json" title="{{ $.Site.Title }}" /> <link href="{{ .RelPermalink }}" rel="alternate" type="application/json"
title="{{ $.Site.Title }}" />
{{ end }} {{ end }}
<!-- Extended head section--> <!-- Extended head section-->