Closed donmckenna closed 4 years ago
There is a docsLinkRewrite
plugin in the demos/plugins
folder that takes care of this. For usage now I would refer to the scully-docs config, as it is used there.
I have an active todo to move this to our plugins folder, and to document it
Thanks Sander :)
🐞 Bug report
Description
When Scully renders my
.md
files intohtml
files, the resulting markup looks to be correct, however fragment links don't seem to be taking the current route into consideration.For example my page looks like this:
And viewing the source looks like this:
..which looks correct as far as the markup goes.
However, hovering over and navigating to the link seems to show the fragment is not being "applied" to the current route:
Even when I'm not using
http-server
and just open thehtml
file itself fromdist/static
, the incorrect route remains:I've also included
index-sanity_check.html
which is a simplified version of the above page. Its view sourcehtml
looks like this.. similar to the Scully markup:..but its fragment link is correct:
🔬 Minimal Reproduction
Test repo here: https://github.com/donmckenna/scully-md-bug-test
A blank Angular app and the Scully initialization steps in https://scully.io/docs/getting-started and https://scully.io/docs/blog to create a Scully "blog".
Change
home
route path to be''
Remove boilerplate in
app.component.html
and replace with onlyWithin
blog/this-is-my-post.md
changepublished
totrue
and make a fragment link to the heading
Build the app and run Scully on the build
Mimicking something I watched Aaron do on a livestream,
cd
intodist/static
and runhttp-server
there. The default port for me is:8080
Navigate tolocalhost:8080/blog/this-is-my-post
This is what I see:💻Your Environment
Angular Version:
Scully Version:
From
package.json
However the issue persists even explicitly installing Scully with
npm i @scullyio/scully
which results in🔥 Exception or Error
This error doesn't seem to affect any builds from finishing, and the output files all look to be correct, however at the end of every
npm run scully
there is a little error which changes its "process" every error. I'm not sure it's directly related, but it saysERROR
so I'm including it. I don't get this error with any other command.For example:
But again, every build has the same "process" error, but with a different number as the "process". Building a few in a row gives me something like this: