Open afunkliru opened 2 months ago
I'm not sure that I understood, you expect https://docusaurus.io/blog#Docusaurus-3.1 to scroll to Docusaurus 3.1 title ?
It's hard to understand what it's about indeed, can you please provide a concrete runnable example and screenshots?
What I think I understand is that you have anchor tag links [xyz](#xyz)
appearing above the blog <!-- truncate -->
marker (if any), so they get rendered in the blog paginated views. And you expect clicking those anchors to lead to https://docusaurus.io/blog/post#xyz
instead of https://docusaurus.io/blog/#xyz
, is that correct?
@slorber Yes, I believe what you said is the expected behavior.
I could see a reason for wanting this, and I don't think it's impossible to build—we just need to resolve anchor links to absolute URLs. I'm actually surprised if we are not doing that atm.
I'm actually surprised if we are not doing that atm.
Afaik no we are not doing that atm.
It's not just anchor links, but all relative links in general (which we advise to not use, but still an edge case to solve)
It occurs to me as safe to normalize them, since each page can only map to one slug. But I'm not sure if the Markdown loader can be aware of the current page's mapped URL, or how we should take care of imported Markdown, etc.
Maybe we can at least do this in the blog plugin that processes the truncated
query? Not sure.
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Anchor tags shown on an entry of https://docusaurus.io/blog, doesn't go to the entry page's anchor tag. It goes to the https://docusaurus.io/blog#ANCHOR-TAG.
Reproducible demo
No response
Steps to reproduce
Expected behavior
Expect to go to the entry page's anchor, not to stay on the blog's home page.
Actual behavior
Stays on blog's home page.
Your environment
Self-service