Skip to content

Commit

Permalink
Merge branch 'master' into chalin-styles+links-2021-11-16
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Nov 17, 2021
2 parents 9663049 + 6f95d15 commit 0ed4bc9
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{ hugo.Generator }}
{{ $outputFormat := partial "outputformat.html" . -}}

{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end -}}

{{ $outputFormat := partial "outputformat.html" . -}}
{{ if and hugo.IsProduction (ne $outputFormat "print") -}}
<meta name="robots" content="index, follow">
{{ else -}}
<meta name="robots" content="noindex, nofollow">
{{ end -}}

{{ partialCached "favicons.html" . }}
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
<!-- for search engine optimization and third-party search engines like Elastic App Search-->
{{ if .Page.Description }}
<meta name="description" content="{{ .Page.Description }}">
{{ else }}
{{ $desc := (.Page.Content | safeHTML | truncate 150) }}
<meta name="description" content="{{ $desc }}">
{{ end }}

{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/schema.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}

{{ partialCached "head-css.html" . "asdf" }}
<title>
{{- if .IsHome -}}
{{ .Site.Title -}}
{{ else -}}
{{ with .Title }}{{ . }} | {{ end -}}
{{ .Site.Title -}}
{{ end -}}
</title>
{{ $desc := .Page.Description | default (.Page.Content | safeHTML | truncate 150) -}}
<meta name="description" content="{{ $desc }}">
{{ template "_internal/opengraph.html" . -}}
{{ template "_internal/schema.html" . -}}
{{ template "_internal/twitter_cards.html" . -}}
{{ partialCached "head-css.html" . "asdf" -}}
<script
src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
crossorigin="anonymous"></script>
{{ if .Site.Params.offlineSearch }}
{{ if .Site.Params.offlineSearch -}}
<script
src="https://unpkg.com/[email protected]/lunr.min.js"
integrity="sha384-vRQ9bDyE0Wnu+lMfm57BlYLO0/XauFuKpVsZPs7KEDwYKktWi5+Kz3MP8++DFlRY"
crossorigin="anonymous"></script>
{{end}}
{{ if .Site.Params.prism_syntax_highlighting }}
<!-- stylesheet for Prism -->
{{ end -}}

{{ if .Site.Params.prism_syntax_highlighting -}}
<link rel="stylesheet" href="{{ "/css/prism.css" | relURL }}"/>
{{ end }}
{{ partial "hooks/head-end.html" . }}
<!--To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled -->
{{ if hugo.IsProduction }}
{{ if hasPrefix .Site.GoogleAnalytics "G-"}}
{{ template "_internal/google_analytics.html" . }}
{{ else }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{ end }}
{{ end -}}

{{ partial "hooks/head-end.html" . -}}

{{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}}
{{ if hugo.IsProduction -}}
{{ if hasPrefix .Site.GoogleAnalytics "G-" -}}
{{ template "_internal/google_analytics.html" . -}}
{{ else -}}
{{ template "_internal/google_analytics_async.html" . -}}
{{ end -}}
{{ end -}}

0 comments on commit 0ed4bc9

Please sign in to comment.