From 4c0e0210aee39f9a98167e87a71d972a58f09036 Mon Sep 17 00:00:00 2001 From: Allen Lee Date: Fri, 22 May 2026 22:36:29 -0700 Subject: [PATCH 1/2] fix: switch to relative urls --- .github/workflows/gh-pages.yml | 4 ++-- AGENTS.md | 4 ++++ assets/scss/_variables_project.scss | 18 +++++++++--------- content/en/_index.html | 2 +- layouts/partials/footer.html | 4 ++-- layouts/partials/hooks/head-end.html | 16 +++++++++++++++- 6 files changed, 33 insertions(+), 15 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 6430d0ad..ab41ec02 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -46,7 +46,7 @@ jobs: --output data/publications.json - name: Restore build cache - uses: actions/cache/restore@v4 + uses: actions/cache/restore@v5 with: path: ${{ env.HUGO_CACHE_HOST_DIR }} key: hugo-${{ runner.os }}-${{ github.run_id }} @@ -69,7 +69,7 @@ jobs: - name: Save build cache if: always() - uses: actions/cache/save@v4 + uses: actions/cache/save@v5 with: path: ${{ env.HUGO_CACHE_HOST_DIR }} key: hugo-${{ runner.os }}-${{ github.run_id }} diff --git a/AGENTS.md b/AGENTS.md index f223c344..ecf2ad67 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -46,6 +46,10 @@ Agent-generated artifacts must be written under `.agent/`. - Do not store secrets, tokens, or private credentials. - Use UTC timestamps in checkpoints and handoffs when possible. +## Static asset paths + +- Prefer base-path-safe asset references (`relURL`, relative paths, or equivalent template-aware indirection) over hardcoded root-relative paths like `/images/...` or `/fonts/...` for deployable site assets. + ## Important dependency versions - Hugo (Docker build arg): `0.161.1` (`Dockerfile`) diff --git a/assets/scss/_variables_project.scss b/assets/scss/_variables_project.scss index b70cf32a..bd2763de 100644 --- a/assets/scss/_variables_project.scss +++ b/assets/scss/_variables_project.scss @@ -20,7 +20,7 @@ $black: #000; src: local("Public Sans Light"), local("PublicSans-Light"), - url("/fonts/public-sans/public-sans-latin-300-normal.woff2") format("woff2"); + var(--omf-public-sans-300-src); } @font-face { @@ -31,7 +31,7 @@ $black: #000; src: local("Public Sans Regular"), local("PublicSans-Regular"), - url("/fonts/public-sans/public-sans-latin-400-normal.woff2") format("woff2"); + var(--omf-public-sans-400-src); } @font-face { @@ -42,7 +42,7 @@ $black: #000; src: local("Public Sans SemiBold"), local("PublicSans-SemiBold"), - url("/fonts/public-sans/public-sans-latin-600-normal.woff2") format("woff2"); + var(--omf-public-sans-600-src); } @font-face { @@ -53,7 +53,7 @@ $black: #000; src: local("Source Serif 4 Regular"), local("SourceSerif4-Regular"), - url("/fonts/source-serif-4/source-serif-4-latin-400-normal.woff2") format("woff2"); + var(--omf-source-serif-4-400-src); } @font-face { @@ -64,7 +64,7 @@ $black: #000; src: local("Source Serif 4 SemiBold"), local("SourceSerif4-SemiBold"), - url("/fonts/source-serif-4/source-serif-4-latin-600-normal.woff2") format("woff2"); + var(--omf-source-serif-4-600-src); } @font-face { @@ -75,7 +75,7 @@ $black: #000; src: local("Source Serif 4 Bold"), local("SourceSerif4-Bold"), - url("/fonts/source-serif-4/source-serif-4-latin-700-normal.woff2") format("woff2"); + var(--omf-source-serif-4-700-src); } @font-face { @@ -86,7 +86,7 @@ $black: #000; src: local("IBM Plex Mono"), local("IBMPlexMono-Regular"), - url("/fonts/ibm-plex-mono/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); + var(--omf-ibm-plex-mono-400-src); } @font-face { @@ -97,7 +97,7 @@ $black: #000; src: local("IBM Plex Mono Medium"), local("IBMPlexMono-Medium"), - url("/fonts/ibm-plex-mono/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); + var(--omf-ibm-plex-mono-500-src); } @font-face { @@ -108,7 +108,7 @@ $black: #000; src: local("IBM Plex Mono SemiBold"), local("IBMPlexMono-SemiBold"), - url("/fonts/ibm-plex-mono/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); + var(--omf-ibm-plex-mono-600-src); } $omf-primary: #0f2742; diff --git a/content/en/_index.html b/content/en/_index.html index ab908690..efbdbbb9 100644 --- a/content/en/_index.html +++ b/content/en/_index.html @@ -6,7 +6,7 @@ {{< blocks/section color="primary" >}}
- OMF Logo + OMF Logo

The Open Modeling Foundation is an alliance of modeling organizations that coordinates and administers a common, community developed body of standards and best practices among diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 3ef94f6a..b81cb195 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -2,7 +2,7 @@
- Digital Research Alliance of Canada + Digital Research Alliance of Canada
This work was enabled in part by generous support from the Alfred P. Sloan Foundation @@ -11,7 +11,7 @@ {{ with .Site.Params.copyright }}© {{ now.Year }} {{ .}} {{ T "footer_all_rights_reserved" }}{{ end }}
- +
diff --git a/layouts/partials/hooks/head-end.html b/layouts/partials/hooks/head-end.html index 5452d53e..fee87077 100644 --- a/layouts/partials/hooks/head-end.html +++ b/layouts/partials/hooks/head-end.html @@ -9,9 +9,23 @@ "fonts/ibm-plex-mono/ibm-plex-mono-latin-400-normal.woff2" -}} + + {{- range $path := $fontPreloads -}} {{- if fileExists (printf "static/%s" $path) -}} - + {{- end -}} {{- end -}} From ef1c0e7f5ae693ffa0f06fe4128058e7c9430907 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 May 2026 05:45:35 +0000 Subject: [PATCH 2/2] fix: move @font-face rules into Hugo partial with relURL --- assets/scss/_variables_project.scss | 102 --------------------------- layouts/partials/hooks/head-end.html | 81 ++++++++++++++++++--- 2 files changed, 71 insertions(+), 112 deletions(-) diff --git a/assets/scss/_variables_project.scss b/assets/scss/_variables_project.scss index bd2763de..7c6eb905 100644 --- a/assets/scss/_variables_project.scss +++ b/assets/scss/_variables_project.scss @@ -8,108 +8,6 @@ $enable-shadows: true; $white: #fff; $black: #000; -// -// Self-hosted font loading (WOFF2 only) -// - -@font-face { - font-family: "Public Sans"; - font-style: normal; - font-weight: 300; - font-display: swap; - src: - local("Public Sans Light"), - local("PublicSans-Light"), - var(--omf-public-sans-300-src); -} - -@font-face { - font-family: "Public Sans"; - font-style: normal; - font-weight: 400; - font-display: swap; - src: - local("Public Sans Regular"), - local("PublicSans-Regular"), - var(--omf-public-sans-400-src); -} - -@font-face { - font-family: "Public Sans"; - font-style: normal; - font-weight: 600; - font-display: swap; - src: - local("Public Sans SemiBold"), - local("PublicSans-SemiBold"), - var(--omf-public-sans-600-src); -} - -@font-face { - font-family: "Source Serif 4"; - font-style: normal; - font-weight: 400; - font-display: swap; - src: - local("Source Serif 4 Regular"), - local("SourceSerif4-Regular"), - var(--omf-source-serif-4-400-src); -} - -@font-face { - font-family: "Source Serif 4"; - font-style: normal; - font-weight: 600; - font-display: swap; - src: - local("Source Serif 4 SemiBold"), - local("SourceSerif4-SemiBold"), - var(--omf-source-serif-4-600-src); -} - -@font-face { - font-family: "Source Serif 4"; - font-style: normal; - font-weight: 700; - font-display: swap; - src: - local("Source Serif 4 Bold"), - local("SourceSerif4-Bold"), - var(--omf-source-serif-4-700-src); -} - -@font-face { - font-family: "IBM Plex Mono"; - font-style: normal; - font-weight: 400; - font-display: swap; - src: - local("IBM Plex Mono"), - local("IBMPlexMono-Regular"), - var(--omf-ibm-plex-mono-400-src); -} - -@font-face { - font-family: "IBM Plex Mono"; - font-style: normal; - font-weight: 500; - font-display: swap; - src: - local("IBM Plex Mono Medium"), - local("IBMPlexMono-Medium"), - var(--omf-ibm-plex-mono-500-src); -} - -@font-face { - font-family: "IBM Plex Mono"; - font-style: normal; - font-weight: 600; - font-display: swap; - src: - local("IBM Plex Mono SemiBold"), - local("IBMPlexMono-SemiBold"), - var(--omf-ibm-plex-mono-600-src); -} $omf-primary: #0f2742; $omf-secondary: #0e7490; diff --git a/layouts/partials/hooks/head-end.html b/layouts/partials/hooks/head-end.html index fee87077..638e1722 100644 --- a/layouts/partials/hooks/head-end.html +++ b/layouts/partials/hooks/head-end.html @@ -10,16 +10,77 @@ -}}