update theme

This commit is contained in:
Ben Goldsworthy 2023-08-07 18:23:46 -04:00
parent ee87009471
commit 920db1a5ce
43 changed files with 848 additions and 6444 deletions

View file

@ -1 +1 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="{{ range after 1 ( seq .Level ) }}sub{{ end }}heading">{{ .Text | safeHTML }} <a class="heading-anchor" href="#{{ .Anchor | safeURL }}"></a></h{{ .Level }}>
<h{{ .Level }} id="{{ .Anchor }}" class="{{ range after 1 ( seq .Level ) }}sub{{ end }}heading">{{ .Text | safeHTML }} <a class="heading-anchor" href="#{{ .Anchor }}"></a></h{{ .Level }}>

View file

@ -1 +0,0 @@
{{- with 1 -}}{{- end -}}<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>{{- with 1 -}}{{- end -}}

View file

@ -23,19 +23,24 @@
<link rel="canonical" href="{{ .Permalink }}">
{{ with .OutputFormats.Get "rss" }}<link rel="{{ .Rel }}" type="{{ .MediaType.Type | html }}" href="{{ .RelPermalink }}" title="{{ $.Site.Title | safeHTML }}" />{{ end }}
{{ with .OutputFormats.Get "rss" -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type | html }}" href="{{ .RelPermalink }}" title="{{ $.Site.Title | safeHTML }}" />
{{- end }}
<link href="/css/sanitize.css" rel="stylesheet" />
{{- $sass := resources.Get "css/main.scss" }}
{{- $style := $sass | resources.ToCSS | resources.Fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity | html }}">
{{- $mainStylesheet := resources.Get "css/main.scss" }}
{{- $mainStylesheet := $mainStylesheet | resources.ToCSS | resources.Fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $mainStylesheet.Permalink }}" integrity="{{ $mainStylesheet.Data.Integrity | html }}">
{{- $printStylesheet := resources.Get "css/print.scss" }}
{{- $printStylesheet := $printStylesheet | resources.ToCSS | resources.Fingerprint }}
<link rel="stylesheet" media="print" href="{{ $printStylesheet.Permalink }}" integrity="{{ $printStylesheet.Data.Integrity | html }}">
{{- block "header-scripts" . -}}<!-- -->{{- end -}}
{{- block "header-styles" . -}}<!-- -->{{- end -}}
</head>
<body class="site-container site-container{{ block "main-class" . }}{{ end }}">
<body class="site-container site-container{{ block "main-class" . }} layouts-default-baseof{{ end }}">
{{ block "header" . -}}
{{- partialCached "header/site-header.html" . -}}
{{- end }}
@ -50,7 +55,7 @@
<footer class="site-footer">
<p>
By <a href="/">{{ $.Site.Author.name }}</a> |
<a href="{{ $.Site.Params.reportIssueURL }}" target="_blank" rel="noopener noreferrer">Report an Issue</a> |
<a href="{{ $.Site.Params.codeURL }}{{ $.Site.Params.reportIssueURL }}">Report an Issue</a> |
<a href="{{ relref . "privacy-policy" }}">Privacy Policy</a> |
<a href="/{{ .Sitemap.Filename }}">Sitemap</a> |
Built: {{ now.Format "2006-01-02T15:04:05" }}

View file

@ -2,7 +2,7 @@
{{ .Type | singularize }}: &lsquo;{{ .Page.Title | plainify }}&rsquo; | {{ .Site.Title }}
{{ end }}
{{ define "main-class" }}--list{{ end}}
{{ define "main-class" }}--list layouts-default-list{{ end}}
{{ define "main-header" }}
<header class="site-content__header">

View file

@ -2,7 +2,7 @@
{{ .Page.Title | plainify }} | {{ .Site.Title }}
{{ end }}
{{ define "main-class" }}--section{{ end }}
{{ define "main-class" }}--section layouts-default-section{{ end }}
{{ define "main-type" }}.{{ .Params.mainType }}{{ end }}
{{ define "item-type" }}{{ .Params.itemsType }}{{ end }}

View file

@ -2,19 +2,57 @@
{{ define "head-description" }}{{ .Summary | plainify }}{{ end }}
{{ define "main-class" }}--single{{ end }}
{{ define "main-class" }}--single layouts-default-single{{ end }}
{{ define "header-scripts" }}
{{ with .Params.locations }}
{{ $mapJS := resources.Get "js/leaflet.js" | fingerprint }}
<script id="Map-script" src="{{ $mapJS.Permalink }}" integrity="{{ $mapJS.Data.Integrity }}"></script>
{{ end }}
{{ end }}
{{ define "header-styles" }}
{{ with .Params.styles }}
<link rel="stylesheet" type="text/css" href="{{ ( $.Page.Resources.GetMatch "style").RelPermalink }}">
{{ end }}
{{ with .Params.locations }}
<link rel="stylesheet" href="/css/leaflet.css">
{{ end }}
{{ end }}
{{ define "footer-scripts" }}
{{ with .Params.locations }}
<script src="/js/openlayers.js"></script>
{{ $script := resources.Get "js/render-meta-map.js" | resources.ExecuteAsTemplate "render-meta-map.js" . }}
<script src="{{ $script.RelPermalink }}"></script>
<script>
var map = L.map('map').setView([55, -3], 13);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
var latLons = [];
{{ range . }}
{{ with ( index $.Site.Data.locations . ) }}
L.marker([{{ .lat }}, {{ .lon }}]).addTo(map);
latLons.push([{{ .lat }}, {{ .lon }}]);
{{ else }}
{{ warnf "Could not find lat-lon for %q (%q)" . $.File.Path }}
{{ end }}
{{ end }}
map.fitBounds(latLons);
</script>
{{ end }}
{{ with .Params.scripts }}
{{ if in . "mathjax" }}
<script src="/js/polyfill.js"></script>
<script id="MathJax-script" async src="/js/mathjax.js"></script>
<script src="/js/mathjax-config.js"></script>
<script id="MathJax-script" async src="/js/mathjax/tex-chtml.js"></script>
<script src="/js/mathjax/config.js"></script>
{{ end }}
{{ if in . "charts" }}
{{ $chartsCoreJS := resources.Get "js/chart.js" | fingerprint }}
{{ $chartsConfigJS := $.Page.Resources.GetMatch "charts-init" }}
<script id="Charts-script" src="{{ $chartsCoreJS.Permalink }}" integrity="{{ $chartsCoreJS.Data.Integrity }}"></script>
<script id="Charts-config-script" src="{{ $chartsConfigJS.Permalink }}"></script>
{{ end }}
{{ end }}
{{ end }}