You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Module content is rendered by ReactMarkdown with no custom a renderer, so a markdown link becomes a plain <a href>. next/link and basePath are never involved.
The site is deployed with basePath: '/academy' (next.config.ts, added in #57). So an absolute internal link in content:
renders as href="/standalone/standalone-env-setup" and resolves to https://nextcloud.github.io/standalone/standalone-env-setup — outside the project path. 404.
Only in-app navigation written as JSX gets the prefix, because that uses next/link.
Nothing is broken right now
Verified: no content file currently uses an absolute internal link. grep '](/' content/*/*/*.md returns nothing. This is a trap rather than a live bug.
It has already changed how content was written once. In #61, php/beginner/1.md refers to the standalone environment-setup module twice, and both references were deliberately left as prose ("find it in the Standalone section on the course home screen") rather than made into links, specifically because of this.
Why it is worth fixing rather than documenting
It fails in the most confusing possible way: the link works in local development and breaks only once deployed, because next dev also serves under /academy but a mistyped absolute path is easy to miss locally, and nothing in CI checks link targets.
And it is configuration-dependent, which makes it worse. When academy.nextcloud.com lands, basePath and assetPrefix come out (see the note in next.config.ts). At that point absolute links would start working — so a link committed today and found broken could silently "fix itself" later, and one written after the switch would break if the custom domain were ever removed.
Options
Give ReactMarkdown a custom a component that routes internal links through next/link, or prefixes them with basePath from next/config. Fixes it once, for all content, and makes the obvious thing work. Wants care with external links, anchors (#section) and mailto:.
Document "use relative or absolute-URL links only" in AGENTS.md and accept prose cross-references. Cheapest, but relies on everyone remembering, and the failure is invisible until deploy.
The problem
Module content is rendered by
ReactMarkdownwith no customarenderer, so a markdown link becomes a plain<a href>.next/linkandbasePathare never involved.The site is deployed with
basePath: '/academy'(next.config.ts, added in #57). So an absolute internal link in content:renders as
href="/standalone/standalone-env-setup"and resolves tohttps://nextcloud.github.io/standalone/standalone-env-setup— outside the project path. 404.Only in-app navigation written as JSX gets the prefix, because that uses
next/link.Nothing is broken right now
Verified: no content file currently uses an absolute internal link.
grep '](/' content/*/*/*.mdreturns nothing. This is a trap rather than a live bug.It has already changed how content was written once. In #61,
php/beginner/1.mdrefers to the standalone environment-setup module twice, and both references were deliberately left as prose ("find it in the Standalone section on the course home screen") rather than made into links, specifically because of this.Why it is worth fixing rather than documenting
It fails in the most confusing possible way: the link works in local development and breaks only once deployed, because
next devalso serves under/academybut a mistyped absolute path is easy to miss locally, and nothing in CI checks link targets.And it is configuration-dependent, which makes it worse. When
academy.nextcloud.comlands,basePathandassetPrefixcome out (see the note innext.config.ts). At that point absolute links would start working — so a link committed today and found broken could silently "fix itself" later, and one written after the switch would break if the custom domain were ever removed.Options
ReactMarkdowna customacomponent that routes internal links throughnext/link, or prefixes them withbasePathfromnext/config. Fixes it once, for all content, and makes the obvious thing work. Wants care with external links, anchors (#section) andmailto:.AGENTS.mdand accept prose cross-references. Cheapest, but relies on everyone remembering, and the failure is invisible until deploy.pull-request.yml(ci: verify pull requests before they reach main #62) would be the place.Option 1 is the one that stops this recurring. Content authors should not have to know about
basePath.Context
Found while wiring up the standalone module in #61.