Compare commits
5 commits
88b685cf2e
...
af68a0e22d
Author | SHA1 | Date | |
---|---|---|---|
af68a0e22d | |||
4e67efab84 | |||
230c46411b | |||
a83f339dc8 | |||
1da4c591d2 |
116 changed files with 777 additions and 530 deletions
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
title: Blog
|
||||
mainType: https://schema.org/Blog
|
||||
itemsType: https://schema.org/BlogPosting" itemprop="blogPost
|
||||
mainType: Blog
|
||||
itemsType: BlogPosting
|
||||
itemsProp: blogPost
|
||||
cascade:
|
||||
params:
|
||||
images:
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
---
|
||||
title: CV
|
||||
layout: cv
|
||||
type: cv
|
||||
---
|
||||
|
||||
This section is for things you have done in your life, e.g. jobs, roles, qualifications.
|
||||
This section is for things you have done in your life, e.g. jobs, roles,
|
||||
qualifications.
|
||||
|
||||
Click on the sections below to view more details about each experience, or filter the timeline below by using the buttons just above it.
|
||||
Click on the sections below to view more details about each experience, or
|
||||
filter the timeline below by using the buttons just above it.
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
{{ define "title" }}
|
||||
{{- partialCached "head/title.html" ( slice ( .Page.Title | plainify ) .Site.Title ) .Site.Title .Page.Title -}}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-class" }}--section layouts-default-section{{ end }}
|
||||
|
||||
{{ define "main-type" }}.{{ .Params.mainType }}{{ end }}
|
||||
{{ define "item-type" }}{{ .Params.itemsType }}{{ end }}
|
||||
|
||||
{{ define "main-header" }}
|
||||
<header class="site-content__header">
|
||||
<h2 class="page-title">{{ .Title | safeHTML }}
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<a href="{{ .RelPermalink }}" aria-label="{{ $.Title }} RSS feed">
|
||||
<img class="feed-icon" alt="RSS feed" src="{{ $.Site.Params.feedIcon }}">
|
||||
</a>
|
||||
{{ end }}
|
||||
</h2>
|
||||
{{ .Content }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-body" }}
|
||||
{{ partial "items-grid.html" . }}
|
||||
{{ end }}
|
|
@ -1,54 +0,0 @@
|
|||
{{ define "title" }}
|
||||
{{- partialCached "head/title.html" ( slice ( .Page.Title | plainify ) .Site.Title ) .Site.Title .Page.Title -}}
|
||||
{{ end }}
|
||||
|
||||
{{ define "head-description" }}{{ .Summary | plainify }}{{ end }}
|
||||
|
||||
{{ define "main-class" }}--single layouts-default-single{{ end }}
|
||||
|
||||
{{ define "header-scripts" }}
|
||||
{{ with .Params.locations }}
|
||||
<script
|
||||
id="Map-script"
|
||||
src="/js/leaflet/leaflet.js"
|
||||
></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/leaflet.css"
|
||||
/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "footer-scripts" }}
|
||||
{{- partialCached "single/footer-scripts.html" ( dict "pc" . "sc" $ ) . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-header" }}
|
||||
{{ partial "single/main-header.html" ( dict "pc" . "sc" $ ) }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-body" }}
|
||||
<section class="site-content__body">
|
||||
{{- if ( or .Params.internal_links .Params.external_links ) -}}
|
||||
{{- partial "single/main-body/links.html" ( dict "pc" . "sc" $ ) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- partial "single/main-body/content.html" ( dict "pc" . "sc" $ ) -}}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ define "main-footer" }}
|
||||
{{ partial "single/post-meta.html" ( dict "pc" . "sc" $ ) }}
|
||||
{{ end }}
|
|
@ -0,0 +1,47 @@
|
|||
<!--
|
||||
Renders an organisation's parents as a slice.
|
||||
|
||||
@params sc Site context.
|
||||
@params pc Page context.
|
||||
@params organisation Organisation title.
|
||||
-->
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( isset . "sc" ) ) -}}
|
||||
{{- errorf "No site context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "pc" ) ) -}}
|
||||
{{- errorf "No page context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "organisation" ) ) -}}
|
||||
{{- errorf "No organisation passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Variable Assignment -->
|
||||
|
||||
{{- $parents := slice -}}
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
{{- $organisations_pages := ( where .sc.Site.Pages "Type" "cv" ) -}}
|
||||
{{- $matching_organisations_pages := where $organisations_pages "Title" .organisation -}}
|
||||
{{- range $matching_organisations_pages -}}
|
||||
{{- if ( and ( $.pc.Params.redact ) ( ne $.sc.Site.Params.redact "show" ) ) -}}
|
||||
{{- if ( eq $.sc.Site.Params.redact "black" ) -}}
|
||||
{{- $parents = ( $parents | append "███████████████" ) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- else -}}
|
||||
{{- $parents = ( $parents | append ( .Title | htmlUnescape | plainify ) ) -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- else -}}
|
||||
{{ erroridf "missing-organisation" "Could not find organisation '%q' (%q)" .organisation $.pc.File.Path }}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- return $parents -}}
|
|
@ -0,0 +1,60 @@
|
|||
{{- /*
|
||||
Renders an organisation's roles in a timeline.
|
||||
|
||||
@params sc Site context.
|
||||
@params pc Page context.
|
||||
@params organisation_titles Post organisation titles.
|
||||
*/
|
||||
-}}
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( isset . "sc" ) ) -}}
|
||||
{{- errorf "No site context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "pc" ) ) -}}
|
||||
{{- errorf "No page context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "organisation_titles" ) ) -}}
|
||||
{{- errorf "No organisation_titles defined (%q)" .pc.Page.File.Path -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $roles := slice -}}
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
{{- with ( .pc.GetPage "cv/roles" ).Pages -}}
|
||||
{{- range ( where . "Params.organisations" "intersect" $.organisation_titles ) -}}
|
||||
{{- if ( not ( and ( .Params.redact ) ( ne $.sc.Site.Params.redact "show" ) ) ) -}}
|
||||
{{-
|
||||
$roles = $roles | append (
|
||||
printf `["%s", "%s", "%s", %s, %s]`
|
||||
(
|
||||
partialCached
|
||||
"cv/organisation/get_role_organisation_string.html"
|
||||
( dict "sc" $.sc "pc" . )
|
||||
.
|
||||
)
|
||||
(
|
||||
partialCached
|
||||
"cv/organisation/get_role_role_string.html"
|
||||
( dict "sc" $.sc "pc" . )
|
||||
.
|
||||
)
|
||||
(
|
||||
partialCached
|
||||
"cv/organisation/get_role_colour.html"
|
||||
( dict "end_date" .Params.end_date "is_paid" .Params.paid )
|
||||
.Params.end_date .Params.paid
|
||||
)
|
||||
( partialCached "cv/organisation/get_role_start_date.html" .Date .Date )
|
||||
( partialCached "cv/organisation/get_role_end_date.html" .Params.end_date .Params.end_date )
|
||||
)
|
||||
-}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- return ( delimit $roles ", ") -}}
|
50
layouts/_partials/cv/organisation/get_role_colour.html
Normal file
50
layouts/_partials/cv/organisation/get_role_colour.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
<!--
|
||||
Renders a role's class (i.e. colour based on paid/unpaid).
|
||||
|
||||
@params end_date The end date of the role, or undefined if the role is ongoing.
|
||||
@params is_paid Whether the role is paid or not.
|
||||
-->
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( isset . "end_date" ) ) -}}
|
||||
{{- errorf "No end date passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "is_paid" ) ) -}}
|
||||
{{- errorf "No 'is_paid' passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<!-- Variable Assignment -->
|
||||
|
||||
{{- $end_date := .end_date -}}
|
||||
{{- $is_paid := .is_paid -}}
|
||||
|
||||
|
||||
<!-- Variable Initialisation -->
|
||||
|
||||
{{- $unpaid_past := "#FFFFF0" -}}
|
||||
{{- $paid_past := "#FCFCA6" -}}
|
||||
{{- $unpaid_current := "#BBBBB0" -}}
|
||||
{{- $paid_current := "#BCBC7E" -}}
|
||||
{{- $colour := "" -}}
|
||||
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
{{- if $end_date -}}
|
||||
{{- if $is_paid -}}
|
||||
{{- $colour = $paid_past -}}
|
||||
{{- else -}}
|
||||
{{- $colour = $unpaid_past -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if $is_paid -}}
|
||||
{{- $colour = $paid_current -}}
|
||||
{{- else -}}
|
||||
{{- $colour = $unpaid_current -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- return $colour -}}
|
21
layouts/_partials/cv/organisation/get_role_end_date.html
Normal file
21
layouts/_partials/cv/organisation/get_role_end_date.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<!--
|
||||
Renders a role's end date, or today if none is set.
|
||||
|
||||
@params . Role start date. Can be undefined.
|
||||
@return Date
|
||||
-->
|
||||
|
||||
<!-- Variable Initialisation -->
|
||||
|
||||
{{- $end_date := "" -}}
|
||||
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
{{- if . -}}
|
||||
{{- $end_date = . -}}
|
||||
{{- else -}}
|
||||
{{- $end_date = ( now.Format "2006-01-02" ) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return ( printf "new Date('%s')" $end_date ) -}}
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
<!--
|
||||
Renders a role's organization(s) as a comma-delimited list.
|
||||
|
||||
@params sc Site context.
|
||||
@params pc Page context.
|
||||
-->
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( isset . "sc" ) ) -}}
|
||||
{{- errorf "No site context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "pc" ) ) -}}
|
||||
{{- errorf "No page context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Variable Assignment -->
|
||||
|
||||
{{- $parents := slice -}}
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
{{- with .pc.Params.organisations -}}
|
||||
{{- range . -}}
|
||||
{{-
|
||||
$parents = $parents | append (
|
||||
partialCached
|
||||
"cv/organisation/get_organisation_parents.html"
|
||||
( dict "sc" $.sc "pc" $.pc "organisation" . )
|
||||
.
|
||||
)
|
||||
-}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return ( delimit $parents ", ") -}}
|
35
layouts/_partials/cv/organisation/get_role_role_string.html
Normal file
35
layouts/_partials/cv/organisation/get_role_role_string.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
|
||||
<!--
|
||||
Renders a role's role.
|
||||
|
||||
@params sc Site context.
|
||||
@params pc Page context.
|
||||
-->
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( isset . "sc" ) ) -}}
|
||||
{{- errorf "No site context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "pc" ) ) -}}
|
||||
{{- errorf "No page context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Variable Assignment -->
|
||||
|
||||
{{- $role_text := "" -}}
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
{{- if ( and ( .pc.Params.redact ) ( ne .sc.Site.Params.redact "show" ) ) -}}
|
||||
{{- if ( eq .sc.Site.Params.redact "black" ) -}}
|
||||
{{- $role_text = "███████████████" -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- else -}}
|
||||
{{- $role_text = .pc.Title | htmlUnescape | plainify -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $role_text -}}
|
17
layouts/_partials/cv/organisation/get_role_start_date.html
Normal file
17
layouts/_partials/cv/organisation/get_role_start_date.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!--
|
||||
Renders a role's start date.
|
||||
|
||||
@params . Role start date.
|
||||
@return Date
|
||||
-->
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( eq (printf "%T" . ) "time.Time" ) ) -}}
|
||||
{{- errorf "Start date is not a `time.Time`, it's a %T" . -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
{{- return ( printf "new Date('%s')" ( .Format "2006-01-02" ) ) -}}
|
|
@ -5,8 +5,8 @@
|
|||
{{- partialCached "redact-black.html" . -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{ default .Title .Params.markup_title | .Page.RenderString }}
|
||||
<a href="{{- .RelPermalink -}}">
|
||||
{{- default .Title .Params.markup_title | .Page.RenderString -}}
|
||||
</a>
|
||||
{{- range .Sections -}}
|
||||
<ul>
|
|
@ -25,9 +25,9 @@
|
|||
id="{{ .Title | urlize }}"
|
||||
class="h-entry u-url link--tile"
|
||||
href="{{ .RelPermalink }}"
|
||||
itemprop="blogPost"
|
||||
itemprop="{{- ( $.GetPage .Section ).Params.itemsProp -}}"
|
||||
itemscope
|
||||
itemtype="https://schema.org/BlogPosting"
|
||||
itemtype="https://schema.org/{{- default "CreativeWork" ( $.GetPage .Section ).Params.itemsType -}}"
|
||||
>
|
||||
<article
|
||||
class="item-tile lazy {{- with .Params.site }}item-tile--{{ . }}{{ end -}}"
|
|
@ -0,0 +1,57 @@
|
|||
{{- /*
|
||||
Renders a post's locations on a map.
|
||||
|
||||
@params sc Site context.
|
||||
@params pc Page context.
|
||||
@params organisation_titles Post organisation titles.
|
||||
*/
|
||||
-}}
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( isset . "sc" ) ) -}}
|
||||
{{- errorf "No site context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "pc" ) ) -}}
|
||||
{{- errorf "No page context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "organisation_titles" ) ) -}}
|
||||
{{- errorf "No organisation_titles defined" -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
<script>
|
||||
google.charts.load('current', {'packages':['timeline']});
|
||||
google.charts.setOnLoadCallback(drawChart);
|
||||
|
||||
function drawChart() {
|
||||
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([
|
||||
{{- partial "cv/organisation/get_organisation_roles_for_chart.html" ( dict "sc" .sc "pc" .pc "organisation_titles" .organisation_titles ) | safeJS -}}
|
||||
]);
|
||||
|
||||
var options = {
|
||||
title: '{{ .pc.Title | plainify }} Roles Timeline',
|
||||
height: '100%',
|
||||
chartArea: {
|
||||
width: '94%'
|
||||
},
|
||||
width: '100%',
|
||||
timeline: { showBarLabels: true }
|
||||
};
|
||||
|
||||
chart.draw(dataTable, options);
|
||||
}
|
||||
</script>
|
44
layouts/_partials/scripts/show_post_locations_on_map.js
Normal file
44
layouts/_partials/scripts/show_post_locations_on_map.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
{{- /*
|
||||
Renders a post's locations on a map.
|
||||
|
||||
@params pc Page context.
|
||||
@params locations_data Site data of locations.
|
||||
@params locations Post locations.
|
||||
*/
|
||||
-}}
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( isset . "pc" ) ) -}}
|
||||
{{- errorf "No page context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "locations_data" ) ) -}}
|
||||
{{- errorf "No location site data defined" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "locations" ) ) -}}
|
||||
{{- errorf "No post locations defined" -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
var map = L.map('map').setView([55, -3], 13);
|
||||
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
}).addTo(map);
|
||||
|
||||
var latLons = [];
|
||||
{{ $locations_leaf_nodes := partialCached "util/get_location_leaf_nodes.html" .locations_data -}}
|
||||
{{- range .locations -}}
|
||||
{{- with ( index $locations_leaf_nodes ( replaceRE `, [A-Z]+` "" . ) ) -}}
|
||||
L.marker([{{ .lat }}, {{ .lon }}]).addTo(map);
|
||||
latLons.push([{{ .lat }}, {{ .lon }}]);
|
||||
{{- else -}}
|
||||
{{- erroridf "missing-lat-lon" "Could not find lat-lon for %q" . -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
map.fitBounds(latLons);
|
54
layouts/_partials/single/footer-scripts.html
Normal file
54
layouts/_partials/single/footer-scripts.html
Normal file
|
@ -0,0 +1,54 @@
|
|||
{{- /*
|
||||
Renders a single item's required footer JS scripts.
|
||||
|
||||
@params sc Site context.
|
||||
@params pc Page context.
|
||||
*/
|
||||
-}}
|
||||
|
||||
|
||||
<!-- Validation -->
|
||||
|
||||
{{- if ( not ( isset . "sc" ) ) -}}
|
||||
{{- errorf "No site context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( not ( isset . "pc" ) ) -}}
|
||||
{{- errorf "No page context passed" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( and ( .pc.HasShortcode "chart" ) ( not ( .pc.Page.Resources.GetMatch "charts-init" ) ) ) -}}
|
||||
{{- errorf "No 'chart-init' page resource defined (%q)" .pc.Page.File.Path -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<!-- Rendering -->
|
||||
|
||||
{{ if .pc.Params.locations }}
|
||||
<script>
|
||||
{{-
|
||||
(
|
||||
partialCached
|
||||
"scripts/show_post_locations_on_map.js"
|
||||
( dict
|
||||
"pc" .pc
|
||||
"locations_data" .sc.Site.Data.locations
|
||||
"locations" .pc.Params.locations
|
||||
)
|
||||
.pc.Params.locations
|
||||
) | safeJS
|
||||
-}}
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ if .pc.HasShortcode "chart" }}
|
||||
{{- $configJs := ( .pc.Page.Resources.GetMatch "charts-init" | fingerprint ) -}}
|
||||
{{-
|
||||
(
|
||||
partialCached
|
||||
"scripts/charts.js"
|
||||
$configJs
|
||||
$configJs
|
||||
)
|
||||
-}}
|
||||
{{ end }}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue