docs/layouts/partials/head.html

84 lines
4.1 KiB
HTML

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{{ partial "meta.html" . }}
{{- if hugo.IsProduction -}}
<script
src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js"
type="text/javascript"
charset="UTF-8"
data-domain-script="{{ site.Params.analytics.onetrust }}"
></script>
<script type="text/javascript">function OptanonWrapper() {}</script>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','{{ site.Params.analytics.google }}');</script>
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:{{ site.Params.analytics.hotjar.prod | safeJS }},hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
{{- else if (eq hugo.Environment "staging") -}}
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:{{ site.Params.analytics.hotjar.stage | safeJS }},hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
{{ end }}
{{ if hugo.IsProduction }}
{{/* kapa.ai widget */}}
<script>
document.addEventListener("DOMContentLoaded", function () {
var script = document.createElement('script');
script.src = 'https://widget.kapa.ai/kapa-widget.bundle.js';
script.setAttribute('data-website-id', '{{ site.Params.kapa.id }}');
script.setAttribute('data-project-name', 'Docker');
script.setAttribute('data-button-image-height', '29px');
script.setAttribute('data-button-image-width', '40px');
script.setAttribute('data-modal-image-height', '29px');
script.setAttribute('data-modal-image-width', '40px');
script.setAttribute('data-modal-title-color', '#fff');
script.setAttribute('data-project-color', '#086dd7');
script.setAttribute('data-modal-header-bg-color', '#086dd7');
script.setAttribute('data-project-logo', '/assets/images/logo-icon-white.svg');
script.setAttribute('data-font-family', 'Roboto Flex,sans-serif');
script.setAttribute('data-modal-disclaimer', 'This is a custom LLM for answering questions about Docker. Answers are based on the contents of the documentation. This feature is experimental - rate the answers to let us know what you think!');
script.setAttribute('data-modal-disclaimer-bg-color', '#e5f2fc');
script.setAttribute('data-modal-disclaimer-text-color', '#086dd7');
script.setAttribute('data-modal-example-questions','What is a volume?,How do I build multi-platform images?,Can I configure Docker to use a proxy?,What does a Docker subscription include?');
script.async = true;
document.body.appendChild(script);
});
</script>
{{ end }}
{{/* preload Roboto Flex as it's a critical font: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload */}}
<link href="/assets/fonts/RobotoFlex.woff2" rel="preload" as="font" type="font/woff2" crossorigin />
{{ partialCached "utils/css.html" "-" }}
{{ $theme := resources.Get "js/theme.js" | js.Build (dict "minify" true) }}
<script>{{ $theme.Content | safeJS }}</script>
{{ $js := resources.Match "js/src/**.js"
| resources.Concat "scripts.js"
| js.Build (dict
"params" (dict
"apikey" site.Params.algolia.apikey
"appid" site.Params.algolia.appid
"indexname" site.Params.algolia.indexname
)
"targetPath" "scripts.js"
)
}}
<script defer src="{{ $js.Permalink }}"></script>
<link rel="preconnect" href="https://{{ site.Params.algolia.appid }}-dsn.algolia.net" crossorigin />
{{ partialCached "utils/resources.html" "-" }}