Skip to content

Make PR preview links stay in the preview - #177

Open
rly wants to merge 2 commits into
mainfrom
fix-preview-permalinks
Open

Make PR preview links stay in the preview#177
rly wants to merge 2 commits into
mainfrom
fix-preview-permalinks

Conversation

@rly

@rly rly commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #176.

Deploy previews were built with the production baseURL, so every .Permalink link (news "Read More", homepage news cards, event cards, share links) pointed at the live site. Netlify only auto-injects the preview baseURL when the build command is a bare hugo; this repo uses a custom one, so netlify.toml now passes -b $DEPLOY_PRIME_URL for deploy previews and branch deploys.

Two follow-ons found while reviewing the hardcoded links:

  • hugo.yaml's baseURL was stale. Production is GitHub Pages on the nwb.org custom domain, and neurodatawithoutborders.github.io 301s there over plain HTTP, so sitemap.xml and RSS advertised a redirecting host.
  • content/tools/community/nwbview.md had a pasted Hugo error message above its front matter, so Hugo never parsed it. NWBView was missing entirely from the /tools/community/ grid (no category/weight) and its page rendered the error text with an empty title. Broken since Update community tools pages #135.

Event and news pages are deliberately untouched; their links to the old host are archival.

Verification

Built the site locally with Hugo 0.152.2 (the pinned version) and diffed the full 176-page output before vs. after. Every difference is either the github.ionwb.org domain swap or one of the three intended files. With -b $DEPLOY_PRIME_URL, news links resolve to the preview host; the tool grid gains an NWBView card.

Worth clicking a news item's "Read More" on this PR's own preview to confirm.

🤖 Generated with Claude Code

rly and others added 2 commits September 2, 2026 23:58
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
@netlify

netlify Bot commented Sep 3, 2026

Copy link
Copy Markdown

Deploy Preview for nwborg ready!

Name Link
🔨 Latest commit 7b44b50
🔍 Latest deploy log https://app.netlify.com/projects/nwborg/deploys/6a991aaca43ab90008619697
😎 Deploy Preview https://deploy-preview-177--nwborg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rly
rly marked this pull request as ready for review September 3, 2026 07:03
@rly
rly requested a review from oruebel September 3, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

News links in PR Preview go to main website not preview site

1 participant