update theme

This commit is contained in:
Ben Goldsworthy 2023-10-03 13:08:35 +01:00
parent 43ddb22f80
commit a35946ae92
19 changed files with 1418 additions and 223 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -6,8 +6,7 @@
{{ 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>
<script id="Map-script" src="/js/leaflet.js"></script>
{{ end }}
{{ end }}
@ -36,7 +35,7 @@
L.marker([{{ .lat }}, {{ .lon }}]).addTo(map);
latLons.push([{{ .lat }}, {{ .lon }}]);
{{ else }}
{{ warnf "Could not find lat-lon for %q (%q)" . $.File.Path }}
{{ erroridf "missing-lat-lon" "Could not find lat-lon for %q (%q)" . $.File.Path }}
{{ end }}
{{ end }}
map.fitBounds(latLons);
@ -48,11 +47,10 @@
<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>
{{ if in . "charts" }}
{{ $chartsConfigJS := $.Page.Resources.GetMatch "charts-init" | fingerprint }}
<script id="Charts-script" src="/js/chart.js"></script>
<script id="Charts-config-script" src="{{ $chartsConfigJS.Permalink }}" integrity="{{ $chartsConfigJS.Data.Integrity }}"></script>
{{ end }}
{{ end }}
{{ end }}

View File

@ -6,8 +6,7 @@
{{ 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>
<script id="Map-script" src="/js/leaflet.js"></script>
{{ end }}
{{ end }}
@ -36,10 +35,12 @@
L.marker([{{ .lat }}, {{ .lon }}]).addTo(map);
latLons.push([{{ .lat }}, {{ .lon }}]);
{{ else }}
{{ warnf "Could not find lat-lon for %q (%q)" . $.File.Path }}
{{ erroridf "missing-lat-lon" "Could not find lat-lon for %q (%q)" . $.File.Path }}
{{ end }}
{{ end }}
map.fitBounds(latLons);
if (map.getZoom() < 10) map.setZoom(10);
</script>
{{ end }}
{{ with .Params.scripts }}
@ -50,10 +51,9 @@
{{ end }}
{{ end }}
{{ if $.HasShortcode "chart" }}
{{ $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>
{{ $chartsConfigJS := $.Page.Resources.GetMatch "charts-init" | fingerprint }}
<script id="Charts-script" src="/js/chart.js"></script>
<script id="Charts-config-script" src="{{ $chartsConfigJS.Permalink }}" integrity="{{ $chartsConfigJS.Data.Integrity }}"></script>
{{ end }}
{{ end }}
@ -255,7 +255,7 @@
<h2 class="subheading subheading--comments" id="comments">Comments</h2>
<ul class="comment__thread">
{{ .RenderShortcodes }}
</il>
</ul>
</section>
{{ end }}
{{ end }}

View File

@ -5,31 +5,14 @@
{{ define "main-class" }}--section location-map{{ end }}
{{ define "header-scripts" }}
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css"
integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI="
crossorigin=""/>
<link rel="stylesheet" href="/css/leaflet.css"/>
{{ end }}
{{ define "footer-scripts" }}
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM="
crossorigin=""></script>
<script src="/js/leaflet.js"></script>
<script src="/js/leaflet-heat.js"></script>
<script>
/*
(c) 2014, Vladimir Agafonkin
simpleheat, a tiny JavaScript library for drawing heatmaps with Canvas
https://github.com/mourner/simpleheat
*/
!function(){"use strict";function t(i){return this instanceof t?(this._canvas=i="string"==typeof i?document.getElementById(i):i,this._ctx=i.getContext("2d"),this._width=i.width,this._height=i.height,this._max=1,void this.clear()):new t(i)}t.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(t,i){return this._data=t,this},max:function(t){return this._max=t,this},add:function(t){return this._data.push(t),this},clear:function(){return this._data=[],this},radius:function(t,i){i=i||15;var a=this._circle=document.createElement("canvas"),s=a.getContext("2d"),e=this._r=t+i;return a.width=a.height=2*e,s.shadowOffsetX=s.shadowOffsetY=200,s.shadowBlur=i,s.shadowColor="black",s.beginPath(),s.arc(e-200,e-200,t,0,2*Math.PI,!0),s.closePath(),s.fill(),this},gradient:function(t){var i=document.createElement("canvas"),a=i.getContext("2d"),s=a.createLinearGradient(0,0,0,256);i.width=1,i.height=256;for(var e in t)s.addColorStop(e,t[e]);return a.fillStyle=s,a.fillRect(0,0,1,256),this._grad=a.getImageData(0,0,1,256).data,this},draw:function(t){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var i=this._ctx;i.clearRect(0,0,this._width,this._height);for(var a,s=0,e=this._data.length;e>s;s++)a=this._data[s],i.globalAlpha=Math.max(a[2]/this._max,t||.05),i.drawImage(this._circle,a[0]-this._r,a[1]-this._r);var n=i.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),i.putImageData(n,0,0),this},_colorize:function(t,i){for(var a,s=3,e=t.length;e>s;s+=4)a=4*t[s],a&&(t[s-3]=i[a],t[s-2]=i[a+1],t[s-1]=i[a+2])}},window.simpleheat=t}(),/*
(c) 2014, Vladimir Agafonkin
Leaflet.heat, a tiny and fast heatmap plugin for Leaflet.
https://github.com/Leaflet/Leaflet.heat
*/
L.HeatLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(t,i){this._latlngs=t,L.setOptions(this,i)},setLatLngs:function(t){return this._latlngs=t,this.redraw()},addLatLng:function(t){return this._latlngs.push(t),this.redraw()},setOptions:function(t){return L.setOptions(this,t),this._heat&&this._updateOptions(),this.redraw()},redraw:function(){return!this._heat||this._frame||this._map._animating||(this._frame=L.Util.requestAnimFrame(this._redraw,this)),this},onAdd:function(t){this._map=t,this._canvas||this._initCanvas(),t._panes.overlayPane.appendChild(this._canvas),t.on("moveend",this._reset,this),t.options.zoomAnimation&&L.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._canvas),t.off("moveend",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},_initCanvas:function(){var t=this._canvas=L.DomUtil.create("canvas","leaflet-heatmap-layer leaflet-layer"),i=L.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);t.style[i]="50% 50%";var a=this._map.getSize();t.width=a.x,t.height=a.y;var s=this._map.options.zoomAnimation&&L.Browser.any3d;L.DomUtil.addClass(t,"leaflet-zoom-"+(s?"animated":"hide")),this._heat=simpleheat(t),this._updateOptions()},_updateOptions:function(){this._heat.radius(this.options.radius||this._heat.defaultRadius,this.options.blur),this.options.gradient&&this._heat.gradient(this.options.gradient),this.options.max&&this._heat.max(this.options.max)},_reset:function(){var t=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(this._canvas,t);var i=this._map.getSize();this._heat._width!==i.x&&(this._canvas.width=this._heat._width=i.x),this._heat._height!==i.y&&(this._canvas.height=this._heat._height=i.y),this._redraw()},_redraw:function(){var t,i,a,s,e,n,h,o,r,d=[],_=this._heat._r,l=this._map.getSize(),m=new L.Bounds(L.point([-_,-_]),l.add([_,_])),c=void 0===this.options.max?1:this.options.max,u=void 0===this.options.maxZoom?this._map.getMaxZoom():this.options.maxZoom,f=1/Math.pow(2,Math.max(0,Math.min(u-this._map.getZoom(),12))),g=_/2,p=[],v=this._map._getMapPanePos(),w=v.x%g,y=v.y%g;for(t=0,i=this._latlngs.length;i>t;t++)if(a=this._map.latLngToContainerPoint(this._latlngs[t]),m.contains(a)){e=Math.floor((a.x-w)/g)+2,n=Math.floor((a.y-y)/g)+2;var x=void 0!==this._latlngs[t].alt?this._latlngs[t].alt:void 0!==this._latlngs[t][2]?+this._latlngs[t][2]:1;r=x*f,p[n]=p[n]||[],s=p[n][e],s?(s[0]=(s[0]*s[2]+a.x*r)/(s[2]+r),s[1]=(s[1]*s[2]+a.y*r)/(s[2]+r),s[2]+=r):p[n][e]=[a.x,a.y,r]}for(t=0,i=p.length;i>t;t++)if(p[t])for(h=0,o=p[t].length;o>h;h++)s=p[t][h],s&&d.push([Math.round(s[0]),Math.round(s[1]),Math.min(s[2],c)]);this._heat.data(d).draw(this.options.minOpacity),this._frame=null},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),a=this._map._getCenterOffset(t.center)._multiplyBy(-i).subtract(this._map._getMapPanePos());L.DomUtil.setTransform?L.DomUtil.setTransform(this._canvas,a,i):this._canvas.style[L.DomUtil.TRANSFORM]=L.DomUtil.getTranslateString(a)+" scale("+i+")"}}),L.heatLayer=function(t,i){return new L.HeatLayer(t,i)};
</script>
<script>
var map = L.map('map').setView([55, -3], 13);
var map = L.map('map').setView([55, -3], 3);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
@ -37,82 +20,32 @@ L.HeatLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(t,i){this._lat
}).addTo(map);
{{ range $.Site.Data.locations }}
//L.marker([{{ .lat }}, {{ .lon }}]).addTo(map);
L.marker([{{ .lat }}, {{ .lon }}]).addTo(map);
{{ end }}
{{ .Scratch.Set "maxItems" 0 }}
{{ .Scratch.Set "numOfItems" 0 }}
/* warnf "No of locations: %v" ( len $.Site.Data.locations ) */
{{ range $key, $value := $.Site.Data.locations }}
{{ $childPosts := where $.Site.Pages ".Params.locations" "intersect" ( slice $key ) }}
/* warnf "Current location: %v" $key */
/* warnf "Child posts: %v" $childPosts */
{{ .Scratch.Set "numOfItems" ( len $childPosts ) }}
{{ if ( gt ( .Scratch.Get "numOfItems" ) ( .Scratch.Get "maxItems" ) ) }}
/* warnf "Updating maxItems" */
{{ .Scratch.Set "maxItems" ( .Scratch.Get "numOfItems" ) }}
/* warnf "New maxItems: %d" .Scratch.Get "maxItems" */
{{ $.Scratch.Set "numOfItems" ( len $childPosts ) }}
{{ if ( gt ( $.Scratch.Get "numOfItems" ) ( $.Scratch.Get "maxItems" ) ) }}
{{ $.Scratch.Set "maxItems" ( $.Scratch.Get "numOfItems" ) }}
{{ end }}
{{ end }}
/* warnf "maxItems: %v" ( .Scratch.Get "maxItems" ) */
console.log({{ .Scratch.Get "maxItems" }});
L.heatLayer([
{{ range $key, $value := $.Site.Data.locations }}
[ {{ .lat }}, {{ .lon }}, {{ len ( where $.Site.Pages "Params.locations" $key ) }} ],
{{ end }}
], { max: {{ .Scratch.Get "maxItems" }} }).addTo(map);
</script>
<script>
/*
map = new OpenLayers.Map("map");
map.addLayer(new OpenLayers.Layer.OSM());
{{ $minItems := 0 }}
{{ $maxItems := 0 }}
{{ range $.Site.Data.locations }}
{{ $numOfLocations := len ( where $.Site.Pages ".Params.locations" "intersect" . ) }}
{{ if ( gt $numOfLocations $maxItems ) }}
{{ $maxItems := $numOfLocations }}
{{ end }}
{{ end }}
var heatmap = new OpenLayers.Layer.Heatmap({
title: "Heatmap",
weight: function(feature){
return (feature.get('numOfPages')-{{$minItems}}) / ({{$maxItems}}-{{$minItems}});
L.heatLayer(
[
{{- range $key, $value := $.Site.Data.locations -}}
{{- $childPosts := where $.Site.Pages ".Params.locations" "intersect" ( slice $key ) -}}
[ {{ .lat }}, {{ .lon }}, {{ len $childPosts }} ],
{{- end -}}
],
{
max: {{ $.Scratch.Get "maxItems" }},
gradient: { 0.4: 'blue', 0.65: 'lime', 1: 'red' }
}
});
map.addLayer(heatmap);
var markers = new OpenLayers.Layer.Markers( "Markers" );
//map.addLayer(markers);
{{ range $.Site.Data.locations }}
heatmap.addDataPoint(
new OpenLayers.LonLat(
{{ .lon }},
{{ .lat }}
)
);
markers.addMarker(
new OpenLayers.Marker(
new OpenLayers.LonLat(
{{ .lon }},
{{ .lat }}
).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
)
)
);
{{ end }}
map.setCenter([0,0], 5);
*/
).addTo(map);
</script>
{{ end }}

View File

@ -0,0 +1,37 @@
{{ define "title" }}
{{ .Page.Title | plainify }} | {{ .Site.Title }}
{{ end }}
{{ define "main-class" }}--section layouts-cv-organisations-section{{ end }}
{{ define "main-header" }}
{{ if .IsDescendant ( .GetPage "/cv/organisations" ) }}
<header class="site-content__header">
<div class="article-header__featured-image"
{{ if .Params.featured_image }}
{{ with .Resources.GetMatch .Params.featured_image }}
style="background-image: url({{ .RelPermalink }})"
{{ end }}
{{ end }}>
<div class="article-header__title-wrapper{{ if .Params.title_in_logo }} article-header__title-wrapper--no-title{{ end }}">
<h2 class="article-header__title">{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</h2>
</div>
</div>
</header>
{{ else }}
<header class="site-content__header">
<h2 class="page-title">{{ .Title | safeHTML }}.</h2>
{{- .Content -}}
</header>
{{ end }}
{{ end }}
{{ define "main-body" }}
{{ with .GetPage "cv/organisations" }}
{{ partial "cv/organisations/items-table.html" . }}
{{ end }}
{{ end }}
{{ define "main-footer" }}
{{ end }}

View File

@ -8,8 +8,7 @@
{{ define "header-scripts" }}
{{ if ( or ( eq .Type "cv" ) ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) }}
{{ $googleChartsJS := resources.Get "js/google-charts.js" | fingerprint }}
<script id="Google-Charts-script" src="{{ $googleChartsJS.Permalink }}" integrity="{{ $googleChartsJS.Data.Integrity }}"></script>
<script id="Google-Charts-script" src="/js/google-charts.js"></script>
{{ end }}
{{ end }}
@ -24,22 +23,22 @@
var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Type' });
dataTable.addColumn({ type: 'string', id: 'Job Title' });
dataTable.addColumn({ type: 'string', id: 'style', role: 'style' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
dataTable.addRows([
{{- $unpaid_past := "#FFFFF0" -}}
{{- $paid_past := "#FCFCA6" -}}
{{- $unpaid_current := "#BBBBB0" -}}
{{- $paid_current := "#BCBC7E" -}}
{{ with ( .GetPage "cv/roles" ).Pages -}}
{{- range ( where . ".Params.organisations" "intersect" $titles ) -}}
[
"{{- delimit ( intersect .Params.organisations $titles ) ", " | safeHTML -}}",
"{{- .Title | safeHTML -}}",
[
"{{- delimit ( intersect .Params.organisations $titles ) ", " | safeHTML -}}",
"{{- .Title | plainify -}}",
"{{ if .Params.end_date -}}
{{- if .Params.paid -}}
{{- $paid_past -}}
@ -53,19 +52,19 @@
{{- $unpaid_current -}}
{{- end -}}
{{- end }}",
new Date("{{ .Date.Format "2006-01-02" }}"),
new Date("{{ .Date.Format "2006-01-02" }}"),
new Date("
{{- if .Params.end_date -}}
{{- .Params.end_date -}}
{{- else -}}
{{- now.Format "2006-01-02" -}}
{{- end -}}
")
")
],
{{- end -}}
{{ end -}}
]);
var options = {
title: '{{ .Title | plainify }} Roles Timeline',
height: '100%',
@ -75,61 +74,56 @@
width: '100%',
timeline: { showBarLabels: true }
};
chart.draw(dataTable, options);
}
</script>
{{ else }}
{{ $js := resources.Get "js/roles-chart.js" | resources.ExecuteAsTemplate "/js/render-roles-timeline.js" ( .GetPage "cv/roles" ) }}
<script src="{{ $js.RelPermalink }}"></script>
{{ $js := resources.Get "js/roles-chart.js" | resources.ExecuteAsTemplate "/js/render-roles-timeline.js" ( .GetPage "cv/roles" ) | resources.Fingerprint }}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
{{ end }}
{{ end }}
{{ define "main-header" }}
{{ if .IsDescendant ( .GetPage "/cv/organisations" ) }}
<header class="site-content__header">
<div class="article-header__featured-image"
{{ if .Params.featured_image }}
{{ with .Resources.GetMatch .Params.featured_image }}
style="background-image: url({{ .RelPermalink }})"
{{ end }}
{{ end }}>
<div class="article-header__title-wrapper{{ if .Params.title_in_logo }} article-header__title-wrapper--no-title{{ end }}">
<h2 class="article-header__title">{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</h2>
</div>
</div>
</header>
<header class="site-content__header">
<div class="article-header__featured-image"
{{ if .Params.featured_image }}
{{ with .Resources.GetMatch .Params.featured_image }}
style="background-image: url({{ .RelPermalink }})"
{{ end }}
{{ end }}>
<div class="article-header__title-wrapper{{ if .Params.title_in_logo }} article-header__title-wrapper--no-title{{ end }}">
<h2 class="article-header__title">{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</h2>
</div>
</div>
</header>
{{ else }}
<header class="site-content__header">
<h2 class="page-title">{{ .Title | safeHTML }}.</h2>
{{ .Content }}
{{ if eq .Type "cv" }}
<nav class="page-header__minor-links">
<ul>
{{ range ( where .Sections "Type" "not in" ( slice "cv/roles" ) ).ByTitle }}
<li><a href="{{ .RelPermalink }}"><h3>{{ .Title }}</h3></a> <p>({{ len (where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) }})</p></li>
{{ end }}
</ul>
</nav>
{{ end }}
{{ if eq .Type "cv" }}
<aside class="timeline__legend">
<div>
<label for="legend__past">Past</label>
<div id="legend__past">
<span><div class="colour-square colour-square--unpaid-past"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-past"></div> <p>Paid</p></span>
</div>
</div>
<div>
<label for="legend__current">Current</label>
<div id="legend__current">
<span><div class="colour-square colour-square--unpaid-current"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-current"></div> <p>Paid</p></span>
</div>
</div>
</aside>
{{ end }}
<h2 class="page-title">{{ .Title | safeHTML }}. {{ if not ( or ( eq .Type "cv" ) ( eq .Type "cv/organisations" ) ) -}}
{{- range .AlternativeOutputFormats -}}
<a href="{{ .RelPermalink }}" aria-label="{{ $.Title }} RSS feed">
<img class="feed-icon" alt="RSS feed" src="{{ $.Site.Params.feedIcon }}">
</a>
{{- end -}}
{{- end -}}
</h2>
{{- .Content -}}
{{- if ( and ( eq .Type "cv" ) ( not ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) ) -}}
<nav class="page-header__minor-links">
<ul>
{{ range ( where .Sections "Type" "not in" ( slice "cv/roles" ) ).ByTitle }}
<li><a href="{{ .RelPermalink }}"><h3>{{ .Title }}</h3></a> <p>({{ len (where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) }})</p></li>
{{ end }}
</ul>
</nav>
{{- partialCached "cv/timeline-legend.html" . -}}
{{- else -}}
<nav class="page-header__minor-links">
{{- partial "years-list.html" . -}}
</nav>
{{- end -}}
</header>
{{ end }}
{{ end }}
@ -141,63 +135,47 @@
{{ $titles = $titles | append ( partial "cv/organisations/recursive-children-titles.html" . ) }}
{{ end }}
{{ .Scratch.Set "titles" $titles }}
<main id="organisation-body" class="site-content__body">
<section id="description">
{{ .Content }}
</section>
<section id="roles-timeline">
<aside class="timeline__legend">
<div>
<label for="legend__past">Past</label>
<div id="legend__past">
<span><div class="colour-square colour-square--unpaid-past"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-past"></div> <p>Paid</p></span>
</div>
</div>
<div>
<label for="legend__current">Current</label>
<div id="legend__current">
<span><div class="colour-square colour-square--unpaid-current"></div> <p>Unpaid</p></span>
<span><div class="colour-square colour-square--paid-current"></div> <p>Paid</p></span>
</div>
</div>
</aside>
<div id="timeline" aria-label="Role Time" role="img">Javascript must be enabled to view this chart.</div>
<div id="timeline" aria-label="Roles timeline" role="img">Javascript must be enabled to view this chart.</div>
</section>
<section id="related" class="row">
{{- $titles := .Scratch.Get "titles" -}}
{{ range (where ((.GetPage "blog").Sections) "Title" "Blog Posts") }}
{{ $section_title := .Title }}
{{ with where (where ( where .Site.Pages "Section" "blog" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles }}
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
{{ range (where ((.GetPage "portfolio").Sections) "Title" "!=" "Appearances").ByTitle }}
{{ $section_title := .Title }}
{{ with where (where ( where .Site.Pages "Section" "portfolio" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles }}
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
{{ range (where ((.GetPage "cv").Sections) "Title" "Qualifications") }}
{{ $section_title := .Title }}
{{ with where (where ( where .Site.Pages "Section" "portfolio" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles }}
{{ with where (where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles }}
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
{{ range (where ((.GetPage "cv").Sections) "Title" "Awards") }}
{{ $section_title := .Title }}
{{ with where (where ( where .Site.Pages "Section" "portfolio" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles }}
{{ with where (where ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles }}
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
{{ range (where ((.GetPage "portfolio").Sections) "Title" "Appearances").ByTitle }}
{{ $section_title := .Title }}
{{ with where (where ( where .Site.Pages "Section" "portfolio" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles }}
@ -206,19 +184,13 @@
{{ end }}
</section>
</main>
{{ else }}
{{ if eq .Type "cv" }}
<article class="site-content__body site-content__body--chart">
<div id="timeline" aria-label="Roles Timeline" role="img">Javascript must be enabled to view this chart.</div>
</article>
{{ else if eq .Type "cv/organisations" . }}
{{ with .GetPage "cv/organisations" }}
{{ partial "cv/organisations/items-table.html" . }}
{{ end }}
{{ else }}
{{ partial "items-grid.html" . }}
{{ end }}
{{ end }}
{{ else if eq .Type "cv" }}
<article class="site-content__body site-content__body--chart">
<div id="timeline" aria-label="Roles timeline" role="img">Javascript must be enabled to view this chart.</div>
</article>
{{ else }}
{{ partial "items-grid.html" . }}
{{ end }}
{{ end }}
{{ define "main-footer" }}
@ -227,9 +199,9 @@
<section id="hierarchy">
<h3 class="subheading">Hierarchy</h3>
{{ $.Scratch.Set "parents" ( slice ) }}
{{ partial "cv/organisations/recursive-parents.html" (dict "c" . "g" $ ) }}
{{ partial "cv/organisations/recursive-parents.html" ( dict "c" . "g" $ ) }}
{{- $parents := partial "cv/organisations/reverse-slice.html" ( $.Scratch.Get "parents" ) -}}
{{- range $parents -}}<ul><li class="hierarchy-item hierarchy-item--parent"><a href="{{ .RelPermalink }}">{{ .Title | safeHTML }}</a>{{- end -}}
<ul><li class="hierarchy-item hierarchy-item--current">{{ .Title | safeHTML }}</li>
{{ range .Sections }}<ul>{{ partial "cv/organisations/recursive-children.html" . }}</ul>{{ end }}

View File

@ -34,5 +34,5 @@
</a>
{{- end -}}
{{- else -}}
{{- warnf "Invalid Schema.org type value %q for %q" $itemType .Params.title -}}
{{- erroridf "invalid-schema-type" "Invalid Schema.org type value %q for %q" $itemType .Params.title -}}
{{- end -}}

View File

@ -0,0 +1,13 @@
<!--. is .c-->
<!--$ is .g-->
{{ $scratch := .g.Scratch }}
{{ if .c.Parent }}
{{ if ne .c.Parent.Type "cv/organisations" }}
{{ with .c.Parent }}
{{ partial "cv/organisations/recursive-parents.html" (dict "c" . "g" $.g ) }}
{{ end }}
{{ else }}
{{ $scratch.Set "top-level-parent" .c.Parent }}
{{ end }}
{{ end }}

View File

@ -13,7 +13,7 @@
<tr>
<td>
{{- if .Params.featured_image -}}
<img width="150" height="auto" loading="lazy" src="
<img class="organisation-table__logo" loading="lazy" src="
{{- if .Resources.GetMatch .Params.featured_image -}}
{{- ( .Resources.GetMatch .Params.featured_image ).RelPermalink -}}
{{- else -}}
@ -22,7 +22,13 @@
">
{{- end -}}
</td>
<td><a href="{{ .RelPermalink }}">{{ .Title | safeHTML }}</a></td>
<td>
<a href="{{ .RelPermalink }}">
{{- if .Params.TitleLang -}}<i lang="{{ .Params.TitleLang }}" title="{{ .Params.TitleTrans }}"}>{{- end -}}
{{- with .Params.markup_title -}}{{- . | safeHTML -}}{{- else -}}{{- .Title | safeHTML -}}{{- end -}}
{{- if .Params.TitleLang -}}</i>{{- end -}}
</a>
</td>
<td>{{- if gt (len .Sections) 0 -}}&#10004;{{- end -}}</td>
<td></td>
</tr>

View File

@ -1,9 +1,9 @@
{{ $titles := ( slice )}}
{{ range . }}
{{ $titles = $titles | append (slice (.Title | plainify) )}}
{{ with .Sections }}
{{ $titles = $titles | append ( partial "cv/organisations/recursive-children-titles.html" . ) }}
{{ $titles = $titles | append (slice ( .Title | plainify ) )}}
{{ if .Sections }}
{{ $titles = $titles | append ( partialCached "cv/organisations/recursive-children-titles.html" .Sections .Title) }}
{{ end }}
{{ end }}

View File

@ -1,5 +1,5 @@
<li class="hierarchy-item hierarchy-item--child"><a href="{{ .RelPermalink }}">{{ with .Params.markup_title }}{{ . | safeHTML }}{{ else }}{{ .Title | safeHTML }}{{ end }}</a>
{{ range .Sections }}<ul>
{{ partial "cv/organisations/recursive-children.html" . }}
</ul>{{ end }}
{{- range .Sections -}}<ul>
{{- partialCached "cv/organisations/recursive-children.html" . .Title -}}
</ul>{{- end -}}
</li>

View File

@ -6,7 +6,7 @@
{{ if ne .c.Parent.Type "cv/organisations" }}
{{ with .c.Parent }}
{{ $scratch.Add "parents" ( slice . ) }}
{{ partial "cv/organisations/recursive-parents.html" (dict "c" . "g" $.g ) }}
{{ partialCached "cv/organisations/recursive-parents.html" (dict "c" . "g" $.g ) .Title }}
{{ end }}
{{ end }}
{{ end }}

View File

@ -0,0 +1,16 @@
<aside class="timeline__legend">
<div>
<label for="legend__past">Past</label>
<div id="legend__past">
<button id="past-unpaid" class="legend__button"><p><span class="colour-square colour-square--unpaid-past"></span> Unpaid</p></button>
<button id="past-paid" class="legend__button"><p><span class="colour-square colour-square--paid-past"></span> Paid</p></button>
</div>
</div>
<div>
<label for="legend__current">Current</label>
<div id="legend__current">
<button id="current-unpaid" class="legend__button"><p><span class="colour-square colour-square--unpaid-current"></span> Unpaid</p></button>
<button id="current-paid" class="legend__button"><p><span class="colour-square colour-square--paid-current"></span> Paid</p></button>
</div>
</div>
</aside>

View File

@ -3,6 +3,12 @@
<h2 class="p-name site-header__title" itemprop="name"><a class="u-url" href="{{ .Site.Home.RelPermalink }}" rel="me author">{{ .Site.Title }}</a></h2>
<p class="p-note site-header__tagline" itemprop="about">Views my own. Discussion ≠ endorsement. Do try this at home.</p>
<p class="site-header__icons">~ <a class="u-email" href="mailto:{{ $.Site.Author.email }}" rel="me">&#128231;</a> ~ <a class="u-url" href="{{ .Site.Params.codeURL }}" rel="me">&#128187;</a> ~ <a class="u-key" href="/{{ .Site.Params.keyfile }}" rel="me">&#128272;</a> ~ <a href="/index.xml" aria-label="{{ .Site.Title }} RSS feed"><img class="feed-icon" alt="RSS feed" src="{{ .Site.Params.feedIcon }}"></a> ~</p>
{{ partial "header/site-nav.html" . }}
<nav class="site-header__nav">
<ul>
{{ range ( where .Site.Sections.ByTitle "Type" "in" site.Params.mainSections ) }}
<li><a href="{{ .RelPermalink }}">{{ .Title | safeHTML }}</a></li>
{{ end }}
</ul>
</nav>
{{ end }}
</header>

View File

@ -41,28 +41,28 @@
{{- end -}}
{{- if .GetTerms "organisations" -}}
<section id="post-organisations" class="article-footer__organisations" aria-labelledby="post-organisations-title" itemprop="articleSection">
<h3 id="post-organisations-title">Organisations</h3>
<section id="post-organisations" class="article-footer__organisations" itemprop="articleSection">
<h3>Organisations</h3>
<ul>
{{ $all_organisations := partialCached "get_all_organisations.html" . }}
<!-- TODO: Replace with hierarchy partial -->
{{- range ( .GetTerms "organisations" ) -}}
{{ with ( where $all_organisations "Title" ( .Title | plainify ) ) }}
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</a></li>
{{ end }}
{{ else }}
{{ warnf "Could not find organisation %q (%q)" .Title $.File.Path }}
<li>{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</li>
{{ with ( where $all_organisations "Title" ( .Title | plainify ) ) }}
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</a></li>
{{ end }}
{{ else }}
{{ erroridf "missing-organisation" "Could not find organisation %q (%q)" .Title $.File.Path }}
<li>{{ if ( .Params.markup_title ) }}{{ .Params.markup_title | safeHTML }}{{ else }}{{ .Title }}{{ end }}</li>
{{ end }}
{{- end -}}
</ul>
</section>
{{- end -}}
{{- if .GetTerms "locations" -}}
<section id="post-locations" class="article-footer__locations" aria-labelledby="post-locations-title">
<h3 id="post-locations-title">Locations</h3>
<section id="post-locations" class="article-footer__locations">
<h3>Locations</h3>
<div id="map" style="width: 100%; height: 500px; margin: 0; display: block;"></div>
<ul style="display: none">
{{- range ( .GetTerms "locations" ).ByTitle -}}
@ -73,8 +73,8 @@
{{- end -}}
{{- if .GetTerms "tags" -}}
<section id="post-tags" class="article-footer__tags" aria-labelledby="post-tags-title">
<h3 id="post-tags-title">Tags</h3>
<section id="post-tags" class="article-footer__tags">
<h3>Tags</h3>
<ul>
{{- range ( .GetTerms "tags" ).ByTitle -}}
<li class="p-category"><a href="{{ .RelPermalink }}">{{ .LinkTitle | safeHTML }}</a></li>

View File

@ -1,3 +1,7 @@
{{- if ( not ( .Get "longdesc" ) ) -}}
{{- erroridf "a11y-chart-longdesc" "No longdesc found for chart '%q' (%q)" ( .Get "chart-id" ) .Page.File.Path -}}
{{- end -}}
<figure class="article__figure figure{{ with .Get "class" }} {{ . }}{{ end }}" role="group">
{{- with .Get "chart-id" -}}
<canvas class="figure__chart" id="{{ . }}">

View File

@ -1 +1,11 @@
{{- /**/ -}}{{- partial "cite.html" . -}}{{- /**/ -}}
{{- if .Params.title -}}
{{- if not $.Params.cite -}}
{{- erroridf "missing-cite" "No cite found for citation '%q' (%q)" .Params.title .Page.File.Path -}}
{{- end -}}
{{- else -}}
{{- errorf "No title found for citation (%q)" .Page.File.Path -}}
{{- end -}}
{{- $citeID := cond ( .Params.cite | not | not ) .Params.cite .Params.title -}}
{{- /**/ -}}{{- partialCached "cite.html" . $citeID -}}{{- /**/ -}}

View File

@ -51,7 +51,7 @@
{{- .RelPermalink -}}
{{- end -}}
{{- else -}}
{{- warnf "No poster defined for resource %q (%q)" $src.RelPermalink .Page.File.Path -}}
{{- erroridf "a11y-video-poster" "No poster defined for resource %q (%q)" $src.RelPermalink .Page.File.Path -}}
{{- end -}}
"
itemprop="video">