From a942563fb586228acde42dfcafee72c8d2da6f73 Mon Sep 17 00:00:00 2001 From: rly <310197+rly@users.noreply.github.com> Date: Wed, 2 Sep 2026 23:58:20 -0700 Subject: [PATCH 1/2] Point preview builds and site URLs at the right host Deploy previews built with the production baseURL, so every absolute link a template generated with .Permalink jumped from the preview to the live site. Netlify only injects the preview baseURL for a bare `hugo` command, and this project uses a custom one. Also correct the baseURL itself: production is GitHub Pages on the nwb.org custom domain, and neurodatawithoutborders.github.io 301s there over plain HTTP, so sitemap and RSS entries advertised a redirecting host. The two Online Resources cards that hardcoded that host point to the pages this site already builds. Fixes #176 Co-Authored-By: Claude Opus 5 (1M context) --- content/online-resources/_index.md | 4 ++-- hugo.yaml | 2 +- netlify.toml | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/content/online-resources/_index.md b/content/online-resources/_index.md index 455086f..58b4885 100644 --- a/content/online-resources/_index.md +++ b/content/online-resources/_index.md @@ -13,7 +13,7 @@ resources_section: - title: "Hackathons" content: "NWB Hackathon events and information" image: "/images/hackathon_icon.png" - url: "https://neurodatawithoutborders.github.io/nwb_hackathons/" + url: "/events/" - title: "NWB Neurodata Extension (NDX) Catalog" content: "Discover NWB extensions" image: "/images/ndxcatalog_logo_framed.png" @@ -75,5 +75,5 @@ docs_section: - title: "Core Tools" content: "Documentation for NWB core tools" image: "/images/r-docs.png" - url: "https://neurodatawithoutborders.github.io/tools/core/" + url: "/tools/core/" --- diff --git a/hugo.yaml b/hugo.yaml index a43ec56..df8463b 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -1,4 +1,4 @@ -baseURL: https://neurodatawithoutborders.github.io/ +baseURL: https://nwb.org/ languageCode: en title: Neurodata Without Borders diff --git a/netlify.toml b/netlify.toml index 3d4d6f4..8f3bb59 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,6 +5,15 @@ [build.environment] HUGO_VERSION = "0.152.2" +# Deploy previews and branch deploys are served from their own Netlify URL, so +# build them with that URL as the Hugo baseURL. Absolute links generated by +# templates (.Permalink and friends) then stay inside the deploy being viewed. +[context.deploy-preview] + command = 'hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL && npm_config_yes=true npx pagefind --site "public"' + +[context.branch-deploy] + command = 'hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL && npm_config_yes=true npx pagefind --site "public"' + #[[plugins]] #package = 'netlify-plugin-image-optim' From 7b44b5002263559c5cdaae201346bf369fa1ee4a Mon Sep 17 00:00:00 2001 From: rly <310197+rly@users.noreply.github.com> Date: Wed, 2 Sep 2026 23:58:26 -0700 Subject: [PATCH 2/2] Restore the NWBView front matter A Hugo error message sat above the front matter, so the delimiter was never at the start of the file. The page rendered the error text with an empty title, and the tool grid skipped the card because category and weight were unset. Co-Authored-By: Claude Opus 5 (1M context) --- content/tools/community/nwbview.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/content/tools/community/nwbview.md b/content/tools/community/nwbview.md index 8155bc5..5b6e5c8 100644 --- a/content/tools/community/nwbview.md +++ b/content/tools/community/nwbview.md @@ -1,7 +1,4 @@ -"/Users/bendichter/dev/neurodatawithoutborders.github.io/layouts/shortcodes/tool-grid.html:29:1": parse failed unexpected EOF Error getting the Hugo object: parse failed unexpected EOF -/Users/bendichter/dev/neurodatawithoutborders.github.io/layouts/shortcodes/tool-grid.html:29:1: - ---- +--- title: "NWBView" description: "A cross-platform software with a graphical user interface to display the contents of the binary NWB file format. Written in Rust for high-performance, memory safety and ease of deployment." category: "exploration"