From 7210d1c9597ae9b612120145338111a9352d2e9e Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Wed, 9 Jul 2025 23:50:22 +0200 Subject: [PATCH 1/4] style: fix padding --- assets/css/layout/_footer.scss | 10 +++++++--- assets/css/layout/_grid.scss | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/css/layout/_footer.scss b/assets/css/layout/_footer.scss index 11a25e7..fdbe1f1 100644 --- a/assets/css/layout/_footer.scss +++ b/assets/css/layout/_footer.scss @@ -1,13 +1,17 @@ .site-footer { grid-area: footer; display: block; - inline-size: 100%;; /* Overflows right of viewport otherwise */ - position: fixed; - inset-block-end: 0; + inline-size: 100%; /* Overflows right of viewport otherwise */ + + @include mq("medium") { + position: fixed; + inset-block-end: 0; + } & p { text-align: center; background: $light; + margin-block-start: 0; padding: 0.4em; margin-block-end: unset; border-block-end: none; diff --git a/assets/css/layout/_grid.scss b/assets/css/layout/_grid.scss index 1d5c1b4..793d1da 100644 --- a/assets/css/layout/_grid.scss +++ b/assets/css/layout/_grid.scss @@ -24,7 +24,7 @@ ". page-container ." "footer footer footer"; border: 2px solid black; - margin-inline: 2em; + margin: 2em; } &--homepage { From 728e840dc5af7f3fa52d96642f849aa9d5d422c3 Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Wed, 9 Jul 2025 23:51:12 +0200 Subject: [PATCH 2/4] make warning ignorable --- config/_default/config.yaml | 1 + layouts/_partials/images/get-image.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/_default/config.yaml b/config/_default/config.yaml index 710db1b..e724d4b 100644 --- a/config/_default/config.yaml +++ b/config/_default/config.yaml @@ -66,3 +66,4 @@ markup: ignoreErrors: - "missing-cite" + - "size-set-on-non-resizable" diff --git a/layouts/_partials/images/get-image.html b/layouts/_partials/images/get-image.html index 6cb94d9..65524db 100644 --- a/layouts/_partials/images/get-image.html +++ b/layouts/_partials/images/get-image.html @@ -33,7 +33,7 @@ {{- warnf "Requested size %s is more than image width %d (%q)" $width $img.Width $img.File.Path -}} {{- end -}} {{- else -}} - {{- warnf "Size set on non-resizable image of type %s; ignoring" $img.MediaType.SubType -}} + {{- warnidf "size-set-on-non-resizable" "Size set on non-resizable image of type %s; ignoring" $img.MediaType.SubType -}} {{- end -}} {{- end -}} From 628acae725f9c46e4ac4c234f8547188927b6497 Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Wed, 9 Jul 2025 23:51:29 +0200 Subject: [PATCH 3/4] fix: CSS class modifier injection --- layouts/baseof.single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/baseof.single.html b/layouts/baseof.single.html index 38bca6b..25e6d7b 100644 --- a/layouts/baseof.single.html +++ b/layouts/baseof.single.html @@ -69,7 +69,7 @@ {{- end -}} - + {{- block "header" . -}} {{- partialCached "header/site-header.html" . -}} {{- end -}} From a2a1dd2a7c73d38f9ae3ad0eb7280ef0d2cf4f0e Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Wed, 9 Jul 2025 23:55:07 +0200 Subject: [PATCH 4/4] fix: template layouts resulting in missing singles --- content/cv/_index.md | 3 +-- content/portfolio/_index.md | 2 +- .../{corrigendum.html => corrigenda.html} | 10 ++++----- layouts/cv/{cv.html => cv-root.html} | 10 +++------ .../{section.html => portfolio-root.html} | 12 +--------- layouts/section.html | 22 +++++++++++++++++++ layouts/single.html | 11 ++++++++++ 7 files changed, 44 insertions(+), 26 deletions(-) rename layouts/_partials/single/main-body/{corrigendum.html => corrigenda.html} (72%) rename layouts/cv/{cv.html => cv-root.html} (71%) rename layouts/portfolio/{section.html => portfolio-root.html} (70%) create mode 100644 layouts/section.html create mode 100644 layouts/single.html diff --git a/content/cv/_index.md b/content/cv/_index.md index ffc0584..e3e9e2d 100644 --- a/content/cv/_index.md +++ b/content/cv/_index.md @@ -1,7 +1,6 @@ --- title: CV -layout: cv -type: cv +layout: cv-root --- This section is for things you have done in your life, e.g. jobs, roles, diff --git a/content/portfolio/_index.md b/content/portfolio/_index.md index 2ae4c01..8cafec1 100644 --- a/content/portfolio/_index.md +++ b/content/portfolio/_index.md @@ -1,6 +1,6 @@ --- title: Portfolio -type: portfolio +layout: portfolio-root --- This section is for things you have produced, whatever their formats and media. diff --git a/layouts/_partials/single/main-body/corrigendum.html b/layouts/_partials/single/main-body/corrigenda.html similarity index 72% rename from layouts/_partials/single/main-body/corrigendum.html rename to layouts/_partials/single/main-body/corrigenda.html index c35377c..d3c38e2 100644 --- a/layouts/_partials/single/main-body/corrigendum.html +++ b/layouts/_partials/single/main-body/corrigenda.html @@ -21,17 +21,17 @@

- Corrigendum + Corrigenda

- {{ $file := path.Join $.sc.Page.File.Dir "corrigendum.md" | readFile }} + {{ $file := path.Join $.sc.Page.File.Dir "corrigenda.md" | readFile }} {{ $file | .pc.RenderString }}
diff --git a/layouts/cv/cv.html b/layouts/cv/cv-root.html similarity index 71% rename from layouts/cv/cv.html rename to layouts/cv/cv-root.html index d70485a..ba18557 100644 --- a/layouts/cv/cv.html +++ b/layouts/cv/cv-root.html @@ -1,16 +1,12 @@ {{ define "main-class" }}--section layouts-cv-cv{{ end }} {{ define "header-scripts" }} - {{ if ( or ( eq .Type "cv" ) ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) }} - - {{ end }} + {{ end }} {{ define "footer-scripts" }} - {{ if ( not ( .IsDescendant ( .GetPage "/cv/organisations" ) ) ) }} - {{ $js := resources.Get "js/roles-chart.js" | resources.ExecuteAsTemplate "/js/render-roles-timeline.js" ( .GetPage "cv/roles" ) | resources.Fingerprint }} - - {{- end -}} + {{ $js := resources.Get "js/roles-chart.js" | resources.ExecuteAsTemplate "/js/render-roles-timeline.js" ( .GetPage "cv/roles" ) | resources.Fingerprint }} + {{ end }} {{ define "main-header" }} diff --git a/layouts/portfolio/section.html b/layouts/portfolio/portfolio-root.html similarity index 70% rename from layouts/portfolio/section.html rename to layouts/portfolio/portfolio-root.html index ad2db56..a0bc3ff 100644 --- a/layouts/portfolio/section.html +++ b/layouts/portfolio/portfolio-root.html @@ -10,18 +10,11 @@ {{ end }} {{ .Content }} - - {{ if ne .Type "portfolio" }} - - {{ end }} {{ end }} {{ define "main-body" }} - {{ if eq .Type "portfolio" }} -
+
    {{ range .Sections.ByWeight }} {{ if eq .Weight 10 }}
    {{ end }} @@ -29,7 +22,4 @@ {{ end }}
- {{ else }} - {{ partial "items-grid.html" . }} - {{ end }} {{ end }} diff --git a/layouts/section.html b/layouts/section.html new file mode 100644 index 0000000..32b1f40 --- /dev/null +++ b/layouts/section.html @@ -0,0 +1,22 @@ +{{ define "main-class" }}--section layouts-default-section{{ end }} + +{{ define "main-header" }} +
+

{{ .Title | safeHTML }}. + {{ range .AlternativeOutputFormats -}} + + + + {{ end }} +

+ {{ .Content }} + + +
+{{ end }} + +{{ define "main-body" }} + {{ partial "items-grid.html" . }} +{{ end }} diff --git a/layouts/single.html b/layouts/single.html new file mode 100644 index 0000000..b13bd61 --- /dev/null +++ b/layouts/single.html @@ -0,0 +1,11 @@ +{{ define "main-class" }}--single layouts-default-single{{ end }} + +{{ define "main-body-additional" }} + {{ if fileExists ( path.Join $.Page.File.Dir "appendices.md" ) }} + {{- partial "single/main-body/appendices.html" ( dict "pc" . "sc" $ ) -}} + {{ end }} + + {{ if fileExists ( path.Join $.Page.File.Dir "corrigenda.md" ) }} + {{- partial "single/main-body/corrigenda.html" ( dict "pc" . "sc" $ ) -}} + {{ end }} +{{ end }}