blob: e2a7600fad1f7c9aad57c694395bb98035fed222 [file] [log] [blame]
<!--
Copyright 2021 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<!DOCTYPE html>
<html lang="en" data-layout="{{if .UseResponsiveLayout}}responsive{{end}}" data-local="{{if .LocalMode}}true{{end}}">
<head>
<!-- This will capture unhandled errors during page load for reporting later. -->
<script>
window.addEventListener('error', window.__err=function f(e){f.p=f.p||[];f.p.push(e)});
</script>
<script>
(function() {
const theme = document.cookie.match(/prefers-color-scheme=(light|dark|auto)/)?.[1]
if (theme) {
document.querySelector('html').setAttribute('data-theme', theme);
}
}())
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{block "description" .}}
<meta name="description" content="Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.">
{{end}}
{{block "robots" .}}{{end}}
<meta class="js-gtmID" data-gtmid="{{.GoogleTagManagerID}}">
<link rel="shortcut icon" href="/static/shared/icon/favicon.ico">
{{block "canonical" .}}{{end}}
<link href="/static/frontend/frontend.min.css?version={{.AppVersionLabel}}" rel="stylesheet">
{{if not .LocalMode}}
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Go Packages">
{{end}}
{{block "title" .}}
<title>{{if .HTMLTitle}}{{.HTMLTitle}} - {{end}}Go Packages</title>
{{end}}
{{block "pre-content" .}}{{end}}
</head>
<body>
<!-- loadScript appends JS sources to the document head. It loads scripts as asynchronous
modules by default, eliminating parser-blocking JavaScript. -->
<script>
function loadScript(src, mod = true) {
let s = document.createElement('script');
s.src = src;
if (mod) {
s.type = 'module';
s.async = true;
s.defer = true
}
document.head.appendChild(s);
}
loadScript("/third_party/dialog-polyfill/dialog-polyfill.js", false)
loadScript("/static/frontend/frontend.js");
</script>
{{template "header" .}}
{{template "main" .}}
{{template "footer" .}}
{{template "modals" .}}
{{if not .LocalMode}}
<section class="Cookie-notice js-cookieNotice">
<div>go.dev uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic. <a target=_blank href="https://policies.google.com/technologies/cookies">Learn more.</a></div>
<div><button class="go-Button">Okay</button></div>
</section>
{{end}}
{{if .GoogleTagManagerID}}
<script>
// this will throw if the querySelector can’t find the element
const gtmId = document.querySelector('.js-gtmID').dataset.gtmid;
if (!gtmId) {
throw new Error('Google Tag Manager ID not found');
}
loadScript(`https://www.googletagmanager.com/gtm.js?id=${gtmId}`);
</script>
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id={{.GoogleTagManagerID}}"
height="0" width="0" style="display:none;visibility:hidden">
</iframe>
</noscript>
{{end}}
{{block "post-content" .}}{{end}}
</body>
</html>