oxil-net1
Version:
Oxford Information Labs Netistrar Theme
148 lines (111 loc) • 4.29 kB
HTML
{{- $ampcats := slice "category" "news" "author" "tag" }}
{{- if in $ampcats .Data.Singular -}}
{{- $.Scratch.Set "amp" true -}}
{{- end -}}
{{- with .CurrentSection -}}
{{- with .Param "amp" -}}
{{- $.Scratch.Set "amp" . -}}
{{- end -}}
{{- end -}}
<!DOCTYPE html>
<html {{ if eq (.Scratch.Get "amp") true -}}amp{{- end }} lang="en-GB" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
{{- if eq .Site.Params.meta_csp "true" -}}
{{- with .Site.Params.csp}}
<meta http-equiv="Content-Security-Policy" content="{{. | safeHTML}}" >
{{- end -}}
{{- end -}}
<meta name="description" content="{{- block "description" .}}{{ if .Description }}{{ .Description }}{{ else }}{{.Site.Title}} article: {{.Title}} | Published on {{dateFormat "2006-01-02 11:11" .Lastmod }} | {{.Site.Params.subtitle}}{{end}} {{- end}}">
{{- block "title" .}}<title>{{ if .IsHome }}{{.Site.Params.subtitle}}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ .Site.Title }}{{end}}</title>{{- end}}
<link rel="canonical" href="{{if .Params.canonical_part }}{{.Site.BaseURL}}{{.Params.canonical_part}}{{else}}{{ .Permalink }}{{end}}">
{{if .Params.noindex}}<meta name="robots" content="noindex, nofollow, noarchive">{{end}}
<link rel="icon" type="image/png" href="/favicon.png" />
<link href="{{with .Site.Params.font}}{{.}}{{else}}https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,500,600,700{{end}}" rel="stylesheet">
{{- if eq (.Scratch.Get "amp") true -}}
{{- partial "head-amp" . -}}
{{- else -}}
{{- $stylesheet := .Site.Data.webpack.main -}}
{{- with $stylesheet.css -}}
<link href="{{ relURL . }}" rel="stylesheet">
{{- end -}}
{{- with .Params.css -}}
<style>{{ . | safeCSS }}</style>
{{- end -}}
{{- end -}}
{{- block "schema" . }}{{ partial "schema" .}}{{- end}}
</head>
{{- block "bodytag" . }}<body id="body" data-gauze="hide" data-modal="hide" data-sidebar="hide" class="{{- with .Params.bodyclass}}{{.}}{{end }} {{ if eq (.Scratch.Get "amp") true -}}bk{{- end -}}">{{- end }}
{{- if ne (.Scratch.Get "amp") true -}}{{partial "sidenav" . }}{{- else -}}{{partial "amp-sidenav" . }}{{- end -}}
{{- partial "ote" . -}}
{{ if ne .Params.noheader true -}}
{{ if ne (.Scratch.Get "amp") true -}}
{{- partial "header" . -}}
{{- else -}}
{{- partial "header-amp" . -}}
{{- end -}}
{{- end -}}
{{- block "fixedheaderwrap" . }}<div id="fixedwrap" >{{- end }}
<div class="scroll rel" >
<div class="">
{{- block "herotag" . }}{{- end }}
{{- block "main" . }}{{- end }}
</div>
{{- block "footer" .}}
{{ if (eq .Params.footer "small") }}
{{- partial "footer-small.html" . -}}
{{else}}
{{- partial "footer.html" . -}}
{{end}}
{{- end}}
</div>
<div class="scroll-to-top px075 py050 br8tl br8bl">
<div class="flex flex-col align-center"><i class="net-chevron-up"></i><span>Top</span></div>
</div>
{{- block "fixedheaderwrapend" . }}</div>{{- end }}
<div class="gauze block-body-scroll"></div>
{{- if ne (.Scratch.Get "amp") true -}}
{{ $script := .Site.Data.webpack.main }}
{{ with $script.js }}
<script src="{{ relURL . }}"></script>
{{- end -}}
{{- with .FirstSection -}}
{{- if eq (.Param "js") "help" -}}
{{ $script := .Site.Data.webpack.help }}
{{ with $script.js }}
<script src="{{ relURL . }}"></script>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if or (eq .Site.Params.ga true) (eq .Site.Params.ga "true") -}}
{{- if .Site.Params.ga_code -}}
{{- if eq (.Scratch.Get "amp") true -}}
<amp-analytics type="gtag" data-credentials="include">
<script type="application/json">
{
"vars" : {
"gtag_id": "{{.Site.Params.ga_code}}",
"config" : {
"{{.Site.Params.ga_code}}": { "groups": "default" }
}
}
}
</script>
</amp-analytics>
{{- else -}}
<script async src="https://www.googletagmanager.com/gtag/js?id={{.}}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{.Site.Params.ga_code}}');
</script>
{{- end -}}
{{- end -}}
{{- end -}}
{{- block "bodyclose" . }}
</body>
{{- end }}
</html>