Closed mcmcclur closed 2 months ago
The root cause is that the development site is hosted under /
, and the deployed site is hosted under /project-name/
. Framework only converts links when it can statically analyze them. I can see how this might be confusing in some cases such as the one you're describing; in this case the only way to solve the difference is to use a relative link (e.g., ../../posts/RevealJS/
).
If you dynamically generate links from one page within a Framework project to another page within the same project using code, you might find that it works in development mode but not in production.
This basic difficulty is that the bundler modifies absolute paths for links within a project but fails to do so in some complicated situations. Thus one link looks like
observablehq.cloud/project-name/page
while the other looks only like
observablehq.cloud/page
I'm not sure if I'd definitely call this a bug but it certainly confused me for a bit.
Here's a concrete example on observablehq.cloud and here's the source code.