|
1 |
| -{{- $isBlogPost := eq .Section "blog" }} |
2 |
| -{{- $ogType := cond (.IsHome) "website" "article" }} |
| 1 | +{{/* Adapted from Docsy; changes are to Google Analytics */}} |
| 2 | +{{/* OK to remove once using a modern enough Docsy (eg 0.11.0 or later) */}} |
| 3 | +<meta charset="utf-8"> |
| 4 | +<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
| 5 | +{{ hugo.Generator }} |
| 6 | +{{ range .AlternativeOutputFormats -}} |
| 7 | +<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> |
| 8 | +{{ end -}} |
3 | 9 |
|
4 | 10 | {{ $outputFormat := partial "outputformat.html" . -}}
|
5 | 11 | {{ if and hugo.IsProduction (ne $outputFormat "print") -}}
|
|
8 | 14 | <meta name="robots" content="noindex, nofollow">
|
9 | 15 | {{ end -}}
|
10 | 16 |
|
11 |
| -<!-- alternative translations --> |
12 |
| -{{ range .Translations -}} |
13 |
| -<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}"> |
14 |
| -{{ end -}} |
15 |
| - |
16 |
| -<!-- Docsy head.html begins here --> |
17 |
| -<meta charset="utf-8"> |
18 |
| -<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
19 |
| -{{ hugo.Generator }} |
20 |
| -{{ range .AlternativeOutputFormats -}} |
21 |
| -<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> |
22 |
| -{{ end -}} |
23 | 17 | {{ partialCached "favicons.html" . }}
|
24 |
| -<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title> |
25 |
| -{{- template "_internal/opengraph.html" . -}} |
26 |
| -{{- template "_internal/schema.html" . -}} |
27 |
| -{{- template "_internal/twitter_cards.html" . -}} |
28 |
| -{{- if hugo.IsProduction -}} |
29 |
| -{{ template "_internal/google_analytics.html" . }} |
30 |
| -{{ end }} |
31 |
| -{{ partialCached "head-css.html" . "asdf" }} |
32 |
| -{{ if and (.Site.Params.offlineSearch) (not .Site.Params.gcs_engine_id) }} |
33 |
| -<script src=" https://unpkg.com/[email protected]/lunr.js" ></script> |
34 |
| -<script src="/js/offline-search.js"></script> |
35 |
| -{{end}} |
36 |
| - |
37 |
| -<!-- Docsy head.html ends here --> |
38 |
| - |
39 |
| -<script type="application/ld+json"> |
40 |
| - { |
41 |
| - "@context": "https://schema.org", |
42 |
| - "@type": "Organization", |
43 |
| - "url": "https://kubernetes.io", |
44 |
| - "logo": "https://kubernetes.io/images/favicon.png", |
45 |
| -{{- if not .Site.Params.deprecated }} |
46 |
| - "potentialAction": { |
47 |
| - "@type": "SearchAction", |
48 |
| - "target": {{ printf "%s%s" ("search/" | absURL) "?q={search_term_string}" }}, |
49 |
| - "query-input": "required name=search_term_string" |
50 |
| - } |
51 |
| -{{ end }} |
52 |
| - } |
53 |
| -</script> |
54 |
| -<meta name="theme-color" content="#326ce5"> |
55 |
| -{{ partial "css.html" . }} |
56 |
| -<!-- Content for social media sharing previews --> |
57 |
| -<!-- Facebook uses the og: stuff, while Twitter and others use twitter: --> |
| 18 | +<title> |
| 19 | + {{- if .IsHome -}} |
| 20 | + {{ .Site.Title -}} |
| 21 | + {{ else -}} |
| 22 | + {{ with .Title }}{{ . }} | {{ end -}} |
| 23 | + {{ .Site.Title -}} |
| 24 | + {{ end -}} |
| 25 | +</title> |
58 | 26 | <meta name="description" content="{{ template "partials/page-description.html" . }}">
|
59 |
| -<meta property="og:description" content="{{ template "partials/page-description.html" . }}"> |
60 |
| -<meta name="twitter:description" content="{{ template "partials/page-description.html" . }}"> |
61 |
| -<meta property="og:url" content="{{ .Permalink }}"> |
62 |
| -<meta property="og:title" content="{{ if .Params.title }}{{ .Title }}{{ else }}{{ .Summary | truncate 10 }}{{ end }}"> |
63 |
| -<meta name="twitter:title" content="{{ if .Params.title }}{{ .Title }}{{ else }}{{ .Summary | truncate 10 }}{{ end }}"> |
64 |
| -<meta name="twitter:image" content="https://kubernetes.io/images/favicon.png" /> |
65 |
| -<!-- Alt text for the site image --> |
66 |
| -<meta name="twitter:image:alt" content="{{ site.Title }}"> |
67 |
| -{{ if $isBlogPost }} |
68 |
| -{{ with findRE "<img.*?>" .Content 1 }} |
69 |
| -<meta property="og:image" content="{{ index . 0 | replaceRE ".*src=\"(.+?)\".*" "$1" }}"> |
70 |
| -{{ end }} |
71 |
| -{{ else }} |
72 |
| -<meta property="og:image" content="{{ "/images/kubernetes-horizontal-color.png" | relURL }}"> |
73 |
| -{{ end }} |
74 |
| -<meta property="og:type" content="{{ $ogType }}"> |
| 27 | +{{ template "_internal/opengraph.html" . -}} |
| 28 | +{{ template "_internal/schema.html" . -}} |
| 29 | +{{ template "_internal/twitter_cards.html" . -}} |
| 30 | +{{ partialCached "head-css.html" . "asdf" -}} |
| 31 | +<script |
| 32 | + src="https://code.jquery.com/jquery-3.6.0.min.js" |
| 33 | + integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" |
| 34 | + crossorigin="anonymous"></script> |
| 35 | +{{ if .Site.Params.offlineSearch -}} |
| 36 | +<script defer |
| 37 | + src=" https://unpkg.com/[email protected]/lunr.min.js" |
| 38 | + integrity="sha384-203J0SNzyqHby3iU6hzvzltrWi/M41wOP5Gu+BiJMz5nwKykbkUx8Kp7iti0Lpli" |
| 39 | + crossorigin="anonymous"></script> |
| 40 | +{{ end -}} |
75 | 41 |
|
76 |
| -<script src="/js/jquery-3.6.0.min.js" intregrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" crossorigin="anonymous"></script> |
77 |
| -<!--script src="https://unpkg.com/split.js/dist/split.min.js"></script--> |
78 |
| -<script src="/js/split-1.6.0.js" intregrity="sha384-0blL3GqHy6+9fw0cyY2Aoiwg4onHAtslAs4OkqZY7UQBrR65/K4gI+hxLdWDrjpz"></script> |
| 42 | +{{ if .Site.Params.prism_syntax_highlighting -}} |
| 43 | +<link rel="stylesheet" href="{{ "css/prism.css" | relURL }}"/> |
| 44 | +{{ end -}} |
79 | 45 |
|
80 |
| -{{- if eq (lower .Params.cid) "community" -}} |
81 |
| -<script defer src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> |
82 |
| -{{- end -}} |
83 |
| -{{ with .Params.js }}{{ range (split . ",") }}<script src="{{ (trim . " ") | relURL }}"></script><!-- custom js added --> |
84 |
| -{{ end }}{{ else }}<!-- no custom js detected -->{{ end }} |
| 46 | +{{ partial "hooks/head-end.html" . -}} |
85 | 47 |
|
86 |
| -{{/* make sure that head-end hook comes last */}} |
87 |
| -{{ partial "hooks/head-end.html" . }} |
| 48 | +{{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}} |
| 49 | +{{ if hugo.IsProduction -}} |
| 50 | + {{ template "_internal/google_analytics.html" . }} |
| 51 | +{{ end -}} |
0 commit comments