Update with custom theme files

This commit is contained in:
Ben Goldsworthy 2022-11-10 22:48:02 -07:00
parent 3b303aee07
commit 0c277c2458
45 changed files with 4324 additions and 11 deletions

View file

@ -0,0 +1,8 @@
<!--. is .c-->
<!--$ is .g-->
{{ $scratch := .g.Scratch }}
{{ with ( where ( where .g.Site.Pages "Type" "organisations" ) "Params.parent" .g.File.ContentBaseName ) }}
{{ $scratch.Add "children" ( slice . ) }}
{{ partial "cv/organisations/recursive-children.html" (dict "c" . "g" $.g ) }}
{{ end }}

View file

@ -0,0 +1,26 @@
{{ if gt ( len .content ) 4 }}
<details id="posts" class="org-items row">
<summary>
<h2 class="subheading">{{ .section_title }} ({{ len .content }})</h2>
<div class="index">
{{ range first 4 .content }}
{{ partial "item-tile.html" . }}
{{ end }}
</div>
</summary>
<div class="index">
{{ range after 4 .content }}
{{ partial "item-tile.html" . }}
{{ end }}
</div>
</details>
{{ else }}
<div id="posts" class="org-items row">
<h2 class="subheading">{{ .section_title }} ({{ len .content }})</h2>
<div class="index">
{{ range first 4 .content }}
{{ partial "item-tile.html" . }}
{{ end }}
</div>
</div>
{{ end }}

View file

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

View file

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

View file

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