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

File diff suppressed because it is too large Load diff

View file

@ -2,13 +2,13 @@
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}} {{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}} {{- if or $.IsHome $.IsSection -}}
{{- $pages = where $pctx.RegularPages "Params.redact" "ne" true -}} {{- $pages = where $pctx.RegularPages "Params.redact" "ne" true -}}
{{- else -}} {{- else -}}
{{- $pages = where $pctx.Pages "Params.redact" "ne" true -}} {{- $pages = where $pctx.Pages "Params.redact" "ne" true -}}
{{- end -}} {{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}} {{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}} {{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}} {{- $pages = $pages | first $limit -}}
{{- end -}} {{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

View file

@ -19,31 +19,26 @@
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>' attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map); }).addTo(map);
{{ range $.Site.Data.locations }} {{- range $.Site.Data.locations -}}
L.marker([{{ .lat }}, {{ .lon }}]).addTo(map); /* L.marker([{{ .lat }}, {{ .lon }}]).addTo(map); */
{{ end }} {{- 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 }}
L.heatLayer( L.heatLayer(
[ [
{{- range $key, $value := $.Site.Data.locations -}} {{- range .Site.AllPages -}}
{{- $childPosts := where $.Site.Pages ".Params.locations" "intersect" ( slice $key ) -}} {{- with .Params.locations -}}
[ {{ .lat }}, {{ .lon }}, {{ len $childPosts }} ], {{- range . -}}
{{- with ( index $.Site.Data.locations . ) -}}
[ {{ .lat }}, {{ .lon }} ],
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}} {{- end -}}
], ],
{ {
max: {{ $.Scratch.Get "maxItems" }}, minOpacity: 0.5,
gradient: { 0.4: 'blue', 0.65: 'lime', 1: 'red' } gradient: {0.2: 'blue', 0.5: 'lime', 1: 'red'}
} }
).addTo(map); ).addTo(map);
</script> </script>
@ -51,13 +46,19 @@
{{ define "main-header" }} {{ define "main-header" }}
<header class="site-content__header"> <header class="site-content__header">
<h1 class="page-title">{{ .Title | safeHTML }}.</h1> <h1 class="page-title">{{ .Title | safeHTML }}.</h1>
{{ .Content }} {{ .Content }}
</header> </header>
{{ end }} {{ end }}
{{ define "main-body" }} {{ define "main-body" }}
<article class="site-content__body site-content__body--chart"> <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> </article>
{{ end }} {{ end }}

View file

@ -28,7 +28,7 @@
{{ define "main-body" }} {{ define "main-body" }}
{{ with .GetPage "cv/organisations" }} {{ with .GetPage "cv/organisations" }}
{{ partial "cv/organisations/items-table.html" . }} {{ partial "cv/organisations/organisations-table.html.tmpl" . }}
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -6,111 +6,113 @@
{{- if .IsDescendant ( .GetPage "/cv/organisations" ) -}}--single{{- else -}}--section{{- end }} layouts-cv-section {{- if .IsDescendant ( .GetPage "/cv/organisations" ) -}}--single{{- else -}}--section{{- end }} layouts-cv-section
{{ end }} {{ end }}
{{ define "header-scripts" }} {{ define "header-scripts" }}
{{ if ( or ( eq .Type "cv" ) ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) }} {{ if ( or ( eq .Type "cv" ) ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) }}
<script id="Google-Charts-script" src="/js/google-charts.js"></script> <script id="Google-Charts-script" src="/js/google-charts.js"></script>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ define "footer-scripts" }} {{ define "footer-scripts" }}
{{ if .IsDescendant ( .GetPage "/cv/organisations" ) }} {{ if .IsDescendant ( .GetPage "/cv/organisations" ) }}
{{ $titles := .Scratch.Get "titles" }} {{ $titles := .Scratch.Get "titles" }}
<script> <script>
google.charts.load('current', {'packages':['timeline']}); google.charts.load('current', {'packages':['timeline']});
google.charts.setOnLoadCallback(drawChart); google.charts.setOnLoadCallback(drawChart);
function drawChart() { function drawChart() {
var container = document.getElementById('timeline'); var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container); var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable(); var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Type' }); {{- $unpaid_past := "#FFFFF0" -}}
dataTable.addColumn({ type: 'string', id: 'Job Title' }); {{- $paid_past := "#FCFCA6" -}}
dataTable.addColumn({ type: 'string', id: 'style', role: 'style' }); {{- $unpaid_current := "#BBBBB0" -}}
dataTable.addColumn({ type: 'date', id: 'Start' }); {{- $paid_current := "#BCBC7E" -}}
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([ dataTable.addColumn({ type: 'string', id: 'Type' });
{{- $unpaid_past := "#FFFFF0" -}} dataTable.addColumn({ type: 'string', id: 'Job Title' });
{{- $paid_past := "#FCFCA6" -}} dataTable.addColumn({ type: 'string', id: 'style', role: 'style' });
{{- $unpaid_current := "#BBBBB0" -}} dataTable.addColumn({ type: 'date', id: 'Start' });
{{- $paid_current := "#BCBC7E" -}} dataTable.addColumn({ type: 'date', id: 'End' });
{{ with ( .GetPage "cv/roles" ).Pages -}}
{{- range ( where . ".Params.organisations" "intersect" $titles ) -}} dataTable.addRows([
{{- if ( not ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) ) -}} {{ with ( .GetPage "cv/roles" ).Pages -}}
[ {{- range ( where . ".Params.organisations" "intersect" $titles ) -}}
" {{- if ( not ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) ) -}}
{{- with .Params.organisations -}} [
{{- $.Scratch.Set "parents" ( slice ) -}} "
{{- range . -}} {{- with .Params.organisations -}}
{{- range ( where ( where $.Site.Pages "Type" "cv" ) "Title" . ) -}} {{- $.Scratch.Set "parents" ( slice ) -}}
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}} {{- range . -}}
{{- if ( eq $.Site.Params.redact "black" ) -}} {{- range ( where ( where $.Site.Pages "Type" "cv" ) "Title" . ) -}}
{{- $.Scratch.Set "parents" ( $.Scratch.Get "parents" | append "███████████████" ) -}} {{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- end -}} {{- if ( eq $.Site.Params.redact "black" ) -}}
{{- else -}} {{- $.Scratch.Set "parents" ( $.Scratch.Get "parents" | append "███████████████" ) -}}
{{- $.Scratch.Set "parents" ( $.Scratch.Get "parents" | append ( .Title | plainify ) ) -}}
{{- end -}} {{- end -}}
{{- else -}} {{- else -}}
{{ erroridf "missing-organisation" "Could not find organisation %q (%q)" . $.File.Path }} {{- $.Scratch.Set "parents" ( $.Scratch.Get "parents" | append ( .Title | plainify ) ) -}}
{{- end -}} {{- end -}}
{{- end -}}
{{- delimit ( $.Scratch.Get "parents" ) ", " -}}
{{- $.Scratch.Delete "parents" -}}
{{- end -}}
",
"
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- if ( eq $.Site.Params.redact "black" ) -}}
███████████████
{{- end -}}
{{- else -}}
{{- .Title | plainify -}}
{{- end -}}
",
"{{ if .Params.end_date -}}
{{- if .Params.paid -}}
{{- $paid_past -}}
{{- else -}}
{{- $unpaid_past -}}
{{- end -}}
{{- else -}}
{{- if .Params.paid -}}
{{- $paid_current -}}
{{- else -}} {{- else -}}
{{- $unpaid_current -}} {{ erroridf "missing-organisation" "Could not find organisation %q (%q)" . $.File.Path }}
{{- end -}} {{- end -}}
{{- end }}", {{- end -}}
new Date("{{ .Date.Format "2006-01-02" }}"), {{- delimit ( $.Scratch.Get "parents" ) ", " -}}
new Date(" {{- $.Scratch.Delete "parents" -}}
{{- if .Params.end_date -}} {{- end -}}
{{- .Params.end_date -}} ",
{{- else -}} "
{{- now.Format "2006-01-02" -}} {{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- end -}} {{- if ( eq $.Site.Params.redact "black" ) -}}
") ███████████████
], {{- end -}}
{{- end -}} {{- else -}}
{{- end -}} {{- .Title | plainify -}}
{{ end -}} {{- end -}}
]); ",
"{{ if .Params.end_date -}}
{{- if .Params.paid -}}
{{- $paid_past -}}
{{- else -}}
{{- $unpaid_past -}}
{{- end -}}
{{- else -}}
{{- if .Params.paid -}}
{{- $paid_current -}}
{{- else -}}
{{- $unpaid_current -}}
{{- end -}}
{{- end }}",
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 -}}
{{ end -}}
]);
var options = { var options = {
title: '{{ .Title | plainify }} Roles Timeline', title: '{{ .Title | plainify }} Roles Timeline',
height: '100%', height: '100%',
chartArea: { chartArea: {
width: '94%' width: '94%'
}, },
width: '100%', width: '100%',
timeline: { showBarLabels: true } timeline: { showBarLabels: true }
}; };
chart.draw(dataTable, options); chart.draw(dataTable, options);
} }
</script> </script>
{{ else }} {{- else -}}
{{ $js := resources.Get "js/roles-chart.js" | resources.ExecuteAsTemplate "/js/render-roles-timeline.js" ( .GetPage "cv/roles" ) | resources.Fingerprint }} {{ $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> <script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
{{ end }} {{- end -}}
{{ end }} {{ end }}
{{ define "main-header" }} {{ define "main-header" }}
@ -168,54 +170,16 @@
{{ end }} {{ end }}
{{ .Scratch.Set "titles" $titles }} {{ .Scratch.Set "titles" $titles }}
<main id="organisation-body" class="site-content__body"> <main class="site-content__body organisation">
<section id="description">
{{ .Content }}
</section>
<section id="roles-timeline"> {{- partial "cv/organisation/description.html.tmpl" ( dict "content" .Content ) -}}
<div id="timeline" aria-label="Roles timeline" role="img">Javascript must be enabled to view this chart.</div>
</section>
<section id="related" class="row"> {{- partial "cv/organisation/roles-timeline.html.tmpl" -}}
{{- $titles := .Scratch.Get "titles" -}}
{{ range ( where ( ( .GetPage "blog" ).Sections ) "Title" "Blog Posts" ) }} {{- partial "cv/organisation/related-items.html.tmpl" ( dict "sc" $ "organisation_titles" ( .Scratch.Get "titles" ) "organisation_title" .Title ) -}}
{{ $section_title := .Title }}
{{ with where ( where ( where ( where .Site.Pages "Section" "blog" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
{{ 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 ( where .Site.Pages "Section" "portfolio" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
{{ 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 ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
{{ 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 ( where .Site.Pages "Section" "cv" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
{{ 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 ( where .Site.Pages "Section" "portfolio" ) "Parent.Title" .Title ) ".Params.organisations" "intersect" $titles ) ".Params.redact" false }}
{{ partial "cv/organisations/organisation-items.html" ( dict "section_title" $section_title "content" . ) }}
{{ end }}
{{ end }}
</section>
</main> </main>
{{ else if eq .Type "cv" }} {{ else if eq .Type "cv" }}
<article class="site-content__body site-content__body--chart"> <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> <div id="timeline" aria-label="Roles timeline" role="img">Javascript must be enabled to view this chart.</div>

View file

@ -0,0 +1,9 @@
<!--
Renders the description of an organisation.
@params content Organisation description.
-->
<section id="description" class="organisation__description">
{{ .content }}
</section>

View file

@ -0,0 +1,38 @@
<!--
Return the number of a certain type of items an organisation has.
@params sc Site context.
@params section_title Title of the sub-section to show (e.g. "Blog Posts").
@params organisation_titles `dict` of organsation titles for this org and all of its children.
-->
{{- $sc := .sc -}}
{{- $section_title := .section_title -}}
{{- $organisation_titles := .organisation_titles -}}
{{- $icon := dict
"Roles" "🔨"
"Blog Posts" "📌"
"Web Sites" "✉"
"Programs" "P"
"Writings" "🖉"
"Audiovisuals" "AV"
"Others" "?"
"Qualifications" "Q"
"Awards" "A"
"Appearances" "ME"
-}}
{{- $section_items := default
( where ( where $sc.Site.Pages "Section" "blog" ) "Parent.Title" $section_title )
( default
( where ( where $sc.Site.Pages "Section" "cv" ) "Parent.Title" $section_title )
( where ( where $sc.Site.Pages "Section" "portfolio" ) "Parent.Title" $section_title )
)
-}}
{{- $organisation_items := where $section_items ".Params.organisations" "intersect" $organisation_titles -}}
<span class="organisations-table__items-icon{{- if ( eq ( len $organisation_items ) 0 ) }} organisations-table__items-icon--none{{- end -}}">
{{- index $icon $section_title -}} <br>
{{- ( len $organisation_items ) -}}
</span>

View file

@ -0,0 +1,34 @@
<!--
Renders related items as an unordered list.
@params section_title Title of the sub-section to show (e.g. "Blog Posts").
@params content Related items.
-->
{{- $section_title := .section_title -}}
{{- $content := .content -}}
<h2 class="subheading">{{ $section_title }} ({{ len $content }})</h2>
<ul class="related-items related-items--list">
{{- range $content -}}
{{- $is_expired := and ( isset .Params "end_date" ) ( lt .Params.end_date ( (time now).Format "2006-01-02" ) ) -}}
<li class="related-item{{- if $is_expired }} related-item--expired{{- end -}}">
<a href="{{- .RelPermalink -}}">
{{- .Title | safeHTML -}}
</a>
{{- with .Params.grade -}}
<span class="related-item__grade">
Grade: {{ . -}}
</span>
{{- end -}}
{{- with .Params.end_date -}}
<span class="related-item__expiry">
<abbr title="expire{{- if $is_expired -}}d{{- else -}}s{{- end -}}">Exp</abbr>: {{ dateFormat "Jan 2 2006" . -}}
</span>
{{- end -}}
</li>
{{- end -}}
</ul>

View file

@ -0,0 +1,36 @@
<!--
Renders related items as tiles.
@params section_title Title of the sub-section to show (e.g. "Blog Posts").
@params organisation_title Title of the organisation.
@params content Related items.
-->
{{- $section_title := .section_title -}}
{{- $organisation_title := .organisation_title -}}
{{- $content := .content -}}
{{- if gt ( len $content ) 4 -}}
<details class="related-items related-items--tiles related-items--collapsible">
<summary>
{{- else -}}
<div id="{{ $section_title | anchorize }}" class="related-items related-items--tiles">
{{- end -}}
<h2 class="subheading related-items-title">{{ $section_title }} ({{ len $content }})</h2>
<div class="index">
{{ range first 4 $content }}
{{ partialCached "item-tile.html" . ( print $organisation_title "_" $section_title "_" .Title ) }}
{{ end }}
</div>
{{- if gt ( len $content ) 4 -}}
</summary>
<div class="index">
{{ range after 4 $content }}
{{ partial "item-tile.html" . }}
{{ end }}
</div>
</details>
{{ else }}
</div>
{{ end }}

View file

@ -0,0 +1,30 @@
<!--
Renders the related items for a given organisation for a given section.
@params sc Site context
@params tls Slug of the top-level section of the sub-section.
@params section_title Title of the sub-section to show (e.g. "Blog Posts").
@params organisation_titles `dict` of organsation titles for this org and all of its children.
-->
{{- $sc := .sc -}}
{{- $tls := .tls -}}
{{- $section_title := .section_title -}}
{{- $organisation_titles := .organisation_titles -}}
{{- range ( where ( ( $sc.GetPage $.tls ).Sections ) "Title" $.section_title ) -}}
{{- $section_items := where ( where $sc.Site.Pages "Section" $tls ) "Parent.Title" .Title -}}
{{- $organisation_items := where $section_items ".Params.organisations" "intersect" $organisation_titles -}}
{{- with ( where $organisation_items ".Params.redact" "ne" true ) -}}
{{- if in ( slice "Qualifications" "Awards" ) $section_title -}}
<section id="related-{{ $section_title | anchorize }}" class="related-section related-section--list">
{{- partial "cv/organisation/organisation-items-list.html.tmpl" ( dict "organisation_title" $sc.Title "section_title" $section_title "content" . ) -}}
</section>
{{- else -}}
<section id="related-{{ $section_title | anchorize }}" class="related-section related-section--tiles">
{{- partial "cv/organisation/organisation-items-tiles.html.tmpl" ( dict "section_title" $section_title "content" . ) -}}
</section>
{{- end -}}
{{- end -}}
{{- end -}}

View file

@ -0,0 +1,26 @@
<!--
Renders the related items for a given organisation.
@params sc Site context
@params organisation_titles `dict` of organsation titles for this org and all of its children.
-->
{{- $sc := .sc -}}
{{- $organisation_titles := .organisation_titles -}}
<section id="related" class="organisation__related">
<!-- Blog posts -->
{{- partial "cv/organisation/related-items-section.html.tmpl" ( dict "sc" $sc "tls" "blog" "section_title" "Blog Posts" "organisation_titles" $organisation_titles ) -}}
<!-- Portfolios -->
{{- range ( ( $sc.GetPage "portfolio" ).Sections ).ByWeight -}}
{{- partial "cv/organisation/related-items-section.html.tmpl" ( dict "sc" $sc "tls" "portfolio" "section_title" .Title "organisation_titles" $organisation_titles ) -}}
{{- end -}}
<!-- Qualifications, Awards and Appearances -->
{{- range ( where ( ( $sc.GetPage "cv" ).Sections ) "Title" "not in" ( slice "Organisations" "Roles" ) ).ByWeight }}
{{- partial "cv/organisation/related-items-section.html.tmpl" ( dict "sc" $sc "tls" "cv" "section_title" .Title "organisation_titles" $organisation_titles ) -}}
{{- end -}}
</section>

View file

@ -0,0 +1,7 @@
<!--
Renders a role timeline for an organisation.
-->
<section id="roles-timeline" class="organisation__timeline">
<div id="timeline" aria-label="Roles timeline" role="img">Javascript must be enabled to view this chart.</div>
</section>

View file

@ -0,0 +1,81 @@
<section class="site-content__body">
<table class="organisations-table">
<thead>
<tr>
<th colspan="2">Organisation</th>
<th>Children</th>
<th>Related Items</th>
</tr>
</thead>
<tbody>
{{- range .Pages -}}
{{- $organisation_title := .Title -}}
{{- if ( not ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) ) -}}
{{ $organisation_titles := slice ( $organisation_title | plainify ) }}
{{ with .Sections }}
{{ $organisation_titles = $organisation_titles | append ( partial "cv/organisations/recursive-children-titles.html" . ) }}
{{ end }}
<tr>
<td>
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- if ( eq $.Site.Params.redact "black" ) -}}
{{- partialCached "redact-black.html" . -}}
{{- end -}}
{{- else -}}
{{- if .Params.featured_image -}}
<img class="organisation-table__logo" loading="lazy" src="
{{- if .Resources.GetMatch .Params.featured_image -}}
{{- ( .Resources.GetMatch .Params.featured_image ).RelPermalink -}}
{{- else -}}
{{- .Params.featured_image -}}
{{- end -}}
">
{{- end -}}
{{- end -}}
</td>
<td>
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- if ( eq $.Site.Params.redact "black" ) -}}
{{- partialCached "redact-black.html" . -}}
{{- end -}}
{{- else -}}
<a href="{{ .RelPermalink }}">
{{- if .Params.TitleLang -}}<i lang="{{ .Params.TitleLang }}" title="{{ .Params.TitleTrans }}"}>{{- end -}}
{{- with .Params.markup_title -}}{{- . | safeHTML -}}{{- else -}}{{- $organisation_title | safeHTML -}}{{- end -}}
{{- if .Params.TitleLang -}}</i>{{- end -}}
</a>
{{- end -}}
</td>
<td>
<span class="organisations-table__items-icon{{- if ( eq ( len .Sections ) 0 ) }} organisations-table__items-icon--none{{- end -}}">
🧑‍🧒 <br>
{{- len .Sections -}}
</span>
</td>
<td>
{{- range slice
"Roles"
"Blog Posts"
"Web Sites"
"Programs"
"Writings"
"Audiovisuals"
"Others"
"Qualifications"
"Awards"
"Appearances"
-}}
{{- partialCached "cv/organisation/get-num-of-items.html.tmpl" ( dict "sc" $ "section_title" . "organisation_titles" $organisation_titles ) ( print $organisation_title "_" . ) -}}
{{- end -}}
</td>
</tr>
{{- end -}}
{{- end -}}
</tbody>
</table>
</section>

View file

@ -1,10 +1,10 @@
<section class="site-content__body"> <section class="site-content__body">
{{ range ( ( where .Pages "Draft" false ).GroupByPublishDate "2006" ) }} {{ range ( ( where .Pages "Draft" false ).GroupByPublishDate "2006" ) }}
{{ if ( not ( eq .Key "0001" ) ) }} {{ if ( not ( eq .Key "0001" ) ) }}
{{ partial "header-tile.html" . }} {{ partialCached "header-tile.html" . .Key }}
{{ range .Pages }} {{ range .Pages }}
{{ if ( not ( .IsDescendant ( .GetPage "/cv/roles" ) ) ) }} {{ if ( not ( .IsDescendant ( .GetPage "/cv/roles" ) ) ) }}
{{ partial "item-tile.html" . }} {{ partialCached "item-tile.html" . .Title }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -39,7 +39,7 @@
</ul> </ul>
</section> </section>
{{- end -}} {{- end -}}
{{- if .GetTerms "organisations" -}} {{- if .GetTerms "organisations" -}}
<section id="post-organisations" class="article-footer__organisations" itemprop="articleSection"> <section id="post-organisations" class="article-footer__organisations" itemprop="articleSection">
<h3>Organisations</h3> <h3>Organisations</h3>
@ -47,7 +47,7 @@
{{ $all_organisations := partialCached "get_all_organisations.html" . }} {{ $all_organisations := partialCached "get_all_organisations.html" . }}
<!-- TODO: Replace with hierarchy partial --> <!-- TODO: Replace with hierarchy partial -->
{{- range ( .GetTerms "organisations" ) -}} {{- range ( .GetTerms "organisations" ) -}}
{{ with ( where $all_organisations "Title" ( .Title | plainify ) ) }} {{ with ( union ( union ( where $all_organisations "Title" ( .Title | plainify ) ) ( where $all_organisations "Params.abbreviation" ( .Title | plainify ) ) ) ( where $all_organisations "Params.fka" ( .Title | plainify ) ) ) }}
{{ range . }} {{ range . }}
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}} {{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
{{- if ( eq $.Site.Params.redact "black" ) -}} {{- if ( eq $.Site.Params.redact "black" ) -}}
@ -65,7 +65,7 @@
</ul> </ul>
</section> </section>
{{- end -}} {{- end -}}
{{- if .GetTerms "locations" -}} {{- if .GetTerms "locations" -}}
<section id="post-locations" class="article-footer__locations"> <section id="post-locations" class="article-footer__locations">
<h3>Locations</h3> <h3>Locations</h3>
@ -77,7 +77,7 @@
</ul> </ul>
</section> </section>
{{- end -}} {{- end -}}
{{- if .GetTerms "tags" -}} {{- if .GetTerms "tags" -}}
<section id="post-tags" class="article-footer__tags"> <section id="post-tags" class="article-footer__tags">
<h3>Tags</h3> <h3>Tags</h3>

View file

@ -0,0 +1,11 @@
<!--
Given a top-level section title slug [blog|cv|portfolio], returns all
`Pages` within that top-level section.
@param sc The site content (`$`)
@param section_slug The slug of the section to use [blog|cv|portfolio]
@returns Pages|nil
-->
{{- where ( ( .sc.GetPage "cv" ).Sections ) "Title" .section_title -}}