feat: finish CV

This commit is contained in:
Ben Goldsworthy 2024-02-04 01:40:15 +00:00
parent 941c59b7a7
commit 187900fd5b
16 changed files with 1604 additions and 166 deletions

View file

@ -19,31 +19,26 @@
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
{{ range $.Site.Data.locations }}
L.marker([{{ .lat }}, {{ .lon }}]).addTo(map);
{{ end }}
{{ .Scratch.Set "maxItems" 0 }}
{{ .Scratch.Set "numOfItems" 0 }}
{{ range $key, $value := $.Site.Data.locations }}
{{ $childPosts := where $.Site.Pages ".Params.locations" "intersect" ( slice $key ) }}
{{ $.Scratch.Set "numOfItems" ( len $childPosts ) }}
{{ if ( gt ( $.Scratch.Get "numOfItems" ) ( $.Scratch.Get "maxItems" ) ) }}
{{ $.Scratch.Set "maxItems" ( $.Scratch.Get "numOfItems" ) }}
{{ end }}
{{ end }}
{{- range $.Site.Data.locations -}}
/* L.marker([{{ .lat }}, {{ .lon }}]).addTo(map); */
{{- end -}}
L.heatLayer(
[
{{- range $key, $value := $.Site.Data.locations -}}
{{- $childPosts := where $.Site.Pages ".Params.locations" "intersect" ( slice $key ) -}}
[ {{ .lat }}, {{ .lon }}, {{ len $childPosts }} ],
{{- range .Site.AllPages -}}
{{- with .Params.locations -}}
{{- range . -}}
{{- with ( index $.Site.Data.locations . ) -}}
[ {{ .lat }}, {{ .lon }} ],
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
],
{
max: {{ $.Scratch.Get "maxItems" }},
gradient: { 0.4: 'blue', 0.65: 'lime', 1: 'red' }
minOpacity: 0.5,
gradient: {0.2: 'blue', 0.5: 'lime', 1: 'red'}
}
).addTo(map);
</script>
@ -51,13 +46,19 @@
{{ define "main-header" }}
<header class="site-content__header">
<h1 class="page-title">{{ .Title | safeHTML }}.</h1>
{{ .Content }}
<h1 class="page-title">{{ .Title | safeHTML }}.</h1>
{{ .Content }}
</header>
{{ end }}
{{ define "main-body" }}
<article class="site-content__body site-content__body--chart">
<div id="map" style="width: 100%; height: 500px; margin: 0; display: block;"></div>
<div id="map" style="width: 100%; height: 500px; margin: 0; display: block;"></div>
<ul style="grid-area: section-content">
{{- range $key, $value := $.Site.Data.locations -}}
<li itemscope itemtype="https://schema.org/Place">{{ $key }}</li>
{{- end -}}
</ul>
</article>
{{ end }}