various updates
This commit is contained in:
parent
4955708f0e
commit
ee87009471
37 changed files with 1734 additions and 401 deletions
|
@ -2,12 +2,11 @@
|
|||
|
||||
{{ partialCached "copying.html" . }}
|
||||
|
||||
<html lang="en-gb" itemscope itemtype="https://schema.org/WebSite">
|
||||
<html class="h-card" lang="en-gb" itemscope itemtype="https://schema.org/Blog">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, intitial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex">
|
||||
<!--<meta http-equiv="Content-Security-Policy" content="default-src 'self'">-->
|
||||
<meta name="theme-color" content="#FFFFF0">
|
||||
<meta name="description" content="{{ block "head-description" . }}{{ $.Site.Params.description | html }}{{ end }}">
|
||||
<meta name="twitter:dnt" content="on">
|
||||
|
@ -15,17 +14,25 @@
|
|||
<title itemprop="name">{{- block "title" . -}}{{- .Site.Title }} | {{ .Site.Params.tagline -}}{{- end -}}</title>
|
||||
|
||||
<link rel="license" href="{{ block "head-license" . }}https://creativecommons.org/publicdomain/zero/1.0/{{ end }}">
|
||||
<link rel="me" href="mailto:me+bg@bengoldsworthy.net">
|
||||
<link rel="icon" sizes="192x192" href="/images/icon.png">
|
||||
<link class="u-url u-uid" rel="me" href="{{ .Site.Home.Permalink }}">
|
||||
<link class="u-email" rel="me" href="mailto:me+bg@bengoldsworthy.net">
|
||||
<link class="u-url" rel="me" href="https://github.com/Rumperuu">
|
||||
<link class="u-url" rel="me" href="https://news.ycombinator.com/user?id=Rumperuu">
|
||||
<link class="u-logo" rel="icon" sizes="192x192" href="/images/icon.png">
|
||||
<link class="u-key" rel="author" href="{{ .Site.Params.keyfile }}">
|
||||
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
|
||||
{{ 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 }}">
|
||||
{{- block "header-styles" . -}}<!-- -->{{- end -}}
|
||||
|
||||
|
||||
{{- block "header-scripts" . -}}<!-- -->{{- end -}}
|
||||
|
||||
{{- block "header-styles" . -}}<!-- -->{{- end -}}
|
||||
</head>
|
||||
|
||||
<body class="site-container site-container{{ block "main-class" . }}{{ end }}">
|
||||
|
@ -33,11 +40,11 @@
|
|||
{{- partialCached "header/site-header.html" . -}}
|
||||
{{- end }}
|
||||
|
||||
<main class="site-content site-content{{ block "main-class" . }}{{ end }}" itemscope itemtype="{{ block "main-type" . }}https://schema.org/Thing{{ end }}">
|
||||
<article class="{{ block "article-class" . }}h-entry {{ end }}site-content site-content{{ block "main-class" . }}{{ end }}" itemscope itemtype="https://schema.org/BlogPosting">
|
||||
{{ block "main-header" . }}{{ end }}
|
||||
{{ block "main-body" . }}{{ end }}
|
||||
{{ block "main-footer" . }}{{ end }}
|
||||
</main>
|
||||
</article>
|
||||
|
||||
{{- block "footer" . -}}
|
||||
<footer class="site-footer">
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
{{ define "main-header" }}
|
||||
<header class="site-content__header">
|
||||
<h1 class="page-title">{{ .Type | singularize }}: <q>{{ .Title | safeHTML }}</q>
|
||||
<h2 class="page-title">{{ .Type | singularize }}: <q>{{ .Title | safeHTML }}</q>
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img class="feed-icon" src="/images/feed-icon.png">
|
||||
<a href="{{ .RelPermalink }}" aria-label="{{ $.Title }} RSS feed">
|
||||
<img class="feed-icon" alt="RSS icon" src="{{ $.Site.Params.feedIcon }}">
|
||||
</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
</h2>
|
||||
{{ .Content }}
|
||||
|
||||
<nav class="page-header__minor-links">
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
|
||||
{{ define "main-header" }}
|
||||
<header class="site-content__header">
|
||||
<h1 class="page-title">{{ .Title | safeHTML }}
|
||||
<h2 class="page-title">{{ .Title | safeHTML }}
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img class="feed-icon" src="/images/feed-icon.png">
|
||||
<a href="{{ .RelPermalink }}" aria-label="{{ $.Title }} RSS feed">
|
||||
<img class="feed-icon" alt="RSS icon" src="{{ $.Site.Params.feedIcon }}">
|
||||
</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
</h2>
|
||||
{{ .Content }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
|
|
@ -6,42 +6,14 @@
|
|||
|
||||
{{ define "footer-scripts" }}
|
||||
{{ with .Params.locations }}
|
||||
<script src="https://www.openlayers.org/api/OpenLayers.js"></script>
|
||||
<script>
|
||||
map = new OpenLayers.Map("mapdiv");
|
||||
map.addLayer(new OpenLayers.Layer.OSM());
|
||||
|
||||
var lonLats = [];
|
||||
{{ range . }}
|
||||
{{ with ( index $.Site.Data.locations . ) }}
|
||||
lonLats.push(new OpenLayers.LonLat( {{ .lon }} , {{ .lat }} )
|
||||
.transform(
|
||||
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
|
||||
map.getProjectionObject() // to Spherical Mercator Projection
|
||||
));
|
||||
{{ else }}
|
||||
{{ warnf "Could not find lat-lon for %q (%q)" . $.File.Path }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
/* TODO: Smarter zoom selection */
|
||||
var zoom=5;
|
||||
|
||||
var markers = new OpenLayers.Layer.Markers( "Markers" );
|
||||
map.addLayer(markers);
|
||||
|
||||
for (var i = 0; i < lonLats.length; i++) {
|
||||
markers.addMarker(new OpenLayers.Marker(lonLats[i]));
|
||||
}
|
||||
|
||||
/* TODO: Smarter centering */
|
||||
map.setCenter(lonLats[0], zoom);
|
||||
</script>
|
||||
<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>
|
||||
{{ end }}
|
||||
{{ with .Params.scripts }}
|
||||
{{ if in . "mathjax" }}
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
<script src="/js/polyfill.js"></script>
|
||||
<script id="MathJax-script" async src="/js/mathjax.js"></script>
|
||||
<script src="/js/mathjax-config.js"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@ -58,12 +30,12 @@
|
|||
{{ end }}
|
||||
{{ end }}>
|
||||
<div class="article-header__title-wrapper">
|
||||
<h1 class="article-header__title{{ if gt ( len ( .Title | plainify ) ) 40 }} article-header__title--long{{ end }}">
|
||||
<h2 class="article-header__title{{ if gt ( len ( .Title | plainify ) ) 40 }} article-header__title--long{{ end }}">
|
||||
<span role="text" itemprop="name">{{ .Title | safeHTML }}</span>
|
||||
</h1>
|
||||
{{ with .Params.subtitle }}
|
||||
<p class="article-header__subtitle">{{ . | safeHTML }}</p>
|
||||
{{ end }}
|
||||
</h2>
|
||||
{{ with .Params.subtitle }}
|
||||
<p class="article-header__subtitle">{{ . | safeHTML }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ with .Resources.GetMatch .Params.featured_image }}
|
||||
<p class="attr">
|
||||
|
@ -102,7 +74,7 @@
|
|||
|
||||
{{ if and ( .TableOfContents ) ( ne .TableOfContents "<nav id=\"TableOfContents\"></nav>" ) }}
|
||||
<nav class="article-header__table-of-contents">
|
||||
<h2 class="article-header__subtitle">Table of Contents</h2>
|
||||
<h3 class="article-header__subtitle">Table of Contents</h3>
|
||||
{{ .TableOfContents }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
@ -110,9 +82,39 @@
|
|||
{{ end }}
|
||||
|
||||
{{ define "main-body" }}
|
||||
<article class="site-content__body">
|
||||
<section class="site-content__body">
|
||||
{{- if ( or .Params.internal_links .Params.external_links ) -}}
|
||||
<section class="article__links">
|
||||
{{- with .Params.internal_links -}}
|
||||
<h3>Internal Links</h3>
|
||||
<ul>
|
||||
{{- range . -}}
|
||||
{{ if eq ( printf "%T" . ) "map[string]interface {}" }}
|
||||
<li><a href="{{ .link }}">{{ .title | safeHTML }}</a></li>
|
||||
{{ else }}
|
||||
<li><a href="{{ . }}">Link</a></li>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Params.external_links -}}
|
||||
<h3>External Links</h3>
|
||||
<ul>
|
||||
{{- range . -}}
|
||||
{{ if eq ( printf "%T" . ) "map[string]interface {}" }}
|
||||
<li><a href="{{ .link }}" rel="noopener noreferrer" target="_blank">{{ .title | safeHTML }}</a></li>
|
||||
{{ else }}
|
||||
<li><a href="{{ . }}" rel="noopener noreferrer" target="_blank">Link</a></li>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
</section>
|
||||
{{- end -}}
|
||||
|
||||
{{ .Content }}
|
||||
</article>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-footer" }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue