-
Notifications
You must be signed in to change notification settings - Fork 726
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override head partial to stop indexing old site versions (v1.8) (#3913)
* Override head partial to stop indexing old site versions Signed-off-by: Marc Duiker <[email protected]> * Fix broken links Signed-off-by: Marc Duiker <[email protected]> * Fix typo in link Signed-off-by: Marc Duiker <[email protected]> --------- Signed-off-by: Marc Duiker <[email protected]>
- Loading branch information
1 parent
41468c4
commit 1fdb6b3
Showing
3 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
{{ hugo.Generator }} | ||
{{ range .AlternativeOutputFormats -}} | ||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> | ||
{{ end -}} | ||
|
||
{{ $outputFormat := partial "outputformat.html" . -}} | ||
{{ if and hugo.IsProduction (.Site.Params.allow_search_indexing) (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> | ||
{{ $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 -}} | ||
<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 -}} | ||
<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 -}} |