various updates

This commit is contained in:
Ben Goldsworthy 2023-06-30 21:16:59 -06:00
parent 4955708f0e
commit ee87009471
37 changed files with 1734 additions and 401 deletions

View file

@ -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" }}