blob: 3d118a08bfb41c822c716d53edb3732cb3c4906e [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}}">
<!-- This will capture unhandled errors during page load for reporting later. -->
window.addEventListener('error', window.__err=function f(e){f.p=f.p||[];f.p.push(e)});
(function() {
const theme = document.cookie.match(/prefers-color-scheme=(light|dark|auto)/)?.[1]
if (theme) {
document.querySelector('html').setAttribute('data-theme', theme);
<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.">
{{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">
{{block "title" .}}
<title>Go Packages</title>
{{block "pre-content" .}}{{end}}
<!-- loadScript appends JS sources to the document head. It loads scripts as asynchronous
modules by default, eliminating parser-blocking JavaScript. -->
function loadScript(src, mod = true) {
let s = document.createElement('script');
s.src = src;
if (mod) {
s.type = 'module';
s.async = true;
s.defer = true
loadScript("/third_party/dialog-polyfill/dialog-polyfill.js", false)
{{template "header" .}}
{{template "main" .}}
{{template "footer" .}}
{{template "modals" .}}
{{if .GoogleTagManagerID}}
// 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');
<iframe src="{{.GoogleTagManagerID}}"
height="0" width="0" style="display:none;visibility:hidden">
{{block "post-content" .}}{{end}}