|
| 1 | +<!-- |
| 2 | + ~ Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + ~ or more contributor license agreements. See the NOTICE file |
| 4 | + ~ distributed with this work for additional information |
| 5 | + ~ regarding copyright ownership. The ASF licenses this file |
| 6 | + ~ to you under the Apache License, Version 2.0 (the |
| 7 | + ~ "License"); you may not use this file except in compliance |
| 8 | + ~ with the License. You may obtain a copy of the License at |
| 9 | + ~ |
| 10 | + ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + ~ |
| 12 | + ~ Unless required by applicable law or agreed to in writing, |
| 13 | + ~ software distributed under the License is distributed on an |
| 14 | + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + ~ KIND, either express or implied. See the License for the |
| 16 | + ~ specific language governing permissions and limitations |
| 17 | + ~ under the License. |
| 18 | + --> |
| 19 | +<meta charset="utf-8"> |
| 20 | +<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
| 21 | +{{ range .AlternativeOutputFormats -}} |
| 22 | +<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> |
| 23 | +{{ end -}} |
| 24 | + |
| 25 | +{{ $outputFormat := partial "outputformat.html" . -}} |
| 26 | +{{ if and hugo.IsProduction (ne $outputFormat "print") -}} |
| 27 | +<meta name="robots" content="index, follow"> |
| 28 | +{{ else -}} |
| 29 | +<meta name="robots" content="noindex, nofollow"> |
| 30 | +{{ end -}} |
| 31 | + |
| 32 | +{{ partialCached "favicons.html" . }} |
| 33 | +<title> |
| 34 | + {{- if .IsHome -}} |
| 35 | + {{ .Site.Title -}} |
| 36 | + {{ else -}} |
| 37 | + {{ with .Title }}{{ . }} | {{ end -}} |
| 38 | + {{ .Site.Title -}} |
| 39 | + {{ end -}} |
| 40 | +</title> |
| 41 | +<meta name="description" content="{{ template "partials/page-description.html" . }}"> |
| 42 | +{{ template "_internal/opengraph.html" . -}} |
| 43 | +{{ template "_internal/schema.html" . -}} |
| 44 | +{{ template "_internal/twitter_cards.html" . -}} |
| 45 | +{{ partialCached "head-css.html" . "asdf" -}} |
| 46 | + |
| 47 | +<!-- |
| 48 | +Customization to host jQuery + Lunr JS files on ASF site |
| 49 | +--> |
| 50 | +{{ $jqueryUrl := "https://code.jquery.com/jquery-3.7.1.min.js" -}} |
| 51 | +{{ with resources.GetRemote $jqueryUrl }} |
| 52 | +<script |
| 53 | + src="{{ .RelPermalink }}" |
| 54 | + integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" |
| 55 | + crossorigin="anonymous"></script> |
| 56 | +{{ end -}} |
| 57 | +{{ if .Site.Params.offlineSearch -}} |
| 58 | +{{ $lunrUrl := "https://unpkg.com/ [email protected]/lunr.min.js" -}} |
| 59 | +{{ with resources.GetRemote $lunrUrl }} |
| 60 | +<script defer |
| 61 | + src="{{ .RelPermalink }}" |
| 62 | + integrity="sha384-203J0SNzyqHby3iU6hzvzltrWi/M41wOP5Gu+BiJMz5nwKykbkUx8Kp7iti0Lpli" |
| 63 | + crossorigin="anonymous"></script> |
| 64 | +{{ end -}} |
| 65 | +{{ end -}} |
| 66 | + |
| 67 | +{{ if .Site.Params.prism_syntax_highlighting -}} |
| 68 | +<link rel="stylesheet" href="{{ "css/prism.css" | relURL }}"/> |
| 69 | +{{ end -}} |
| 70 | + |
| 71 | +{{ template "algolia/head" . -}} |
| 72 | + |
| 73 | +{{ partial "hooks/head-end.html" . -}} |
| 74 | + |
| 75 | +{{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}} |
| 76 | +{{ if hugo.IsProduction -}} |
| 77 | + {{ $enableGtagForUniversalAnalytics := not .Site.Params.disableGtagForUniversalAnalytics -}} |
| 78 | + {{ if (or $enableGtagForUniversalAnalytics (hasPrefix .Site.Config.Services.GoogleAnalytics.ID "G-")) -}} |
| 79 | + {{ template "_internal/google_analytics_gtag.html" . -}} |
| 80 | + {{ else -}} |
| 81 | + {{ template "_internal/google_analytics.html" . -}} |
| 82 | + {{ end -}} |
| 83 | +{{ end -}} |
| 84 | + |
| 85 | +{{ define "algolia/head" -}} |
| 86 | + |
| 87 | +{{ if and .Site.Params.search (isset .Site.Params.search "algolia") -}} |
| 88 | +<link rel=" stylesheet" href=" https://cdn.jsdelivr.net/npm/@docsearch/[email protected]" |
| 89 | + integrity="sha512-AyDFDkYyALC5qoao077IqAOV7UC4oKCBTp+mJfjIt306AIRoBxoEZYDo0kAx/R7RbT+3EYEky1po/F1w1eQt7g==" |
| 90 | + crossorigin="anonymous" /> |
| 91 | +{{ end -}} |
| 92 | + |
| 93 | +{{ if ne .Site.Params.algolia_docsearch nil -}} |
| 94 | +{{ warnf `Config 'params.algolia_docsearch' is deprecated: use 'params.search.algolia' |
| 95 | + For details, see https://www.docsy.dev/docs/adding-content/search/#algolia-docsearch.` -}} |
| 96 | +{{ end -}} |
| 97 | + |
| 98 | +{{ end -}} |
0 commit comments