scullyio / scully

The Static Site Generator for Angular apps
https://scully.io/
MIT License
2.55k stars 257 forks source link

Can't link to an anchor in a different page #1588

Open willyboy opened 2 years ago

willyboy commented 2 years ago

🐞 Bug report

Description

The following code should work given that heading-1 exists in the page "another page": [go to another page](./another-page.md#heading-1)

It does not. It appears that Scully sees it as an unmatched route. But it should see it as a matched route with an anchor.

Looking through the source, I thought maybe I could use data-hash to force it to recognize the hash but when data-hash is present, it's assumed that the link is local to the page and so rewrites href to just the hash.

https://github.com/scullyio/scully/blob/45854a591b42c34f114790fa8b54d1583f143f05/libs/ng-lib/src/lib/scully-content/scully-content.component.ts#L186

🔬 Minimal Reproduction

another-page.md

# Heading 1

my-page.md

[go to another page](./another-page.md#heading-1)

"go to another page" link is not updated by Scully.

💻Your Environment

Angular Version:




13.1.4

Scully Version:




1.1.1

🔥 Exception or Error

None




SanderElias commented 2 years ago

Are you talking about another page inside of your app, or on en "external" resource? Can you provide a reproduction sample?