Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of Contents: generate links with just the anchor instead of the full address #42636

Closed
ricjcs opened this issue Jul 22, 2022 · 3 comments
Closed
Labels
[Block] Table of contents (experimental) Affects the Table of contents Block

Comments

@ricjcs
Copy link

ricjcs commented Jul 22, 2022

When creating a Table of Contents, the links have the full address. Example: website.com/post-title/#anchor

Wouldn't it be better if the link was only with "#anchor", as is usually done manually, since it's enough to work and the rest is unnecessary? Is it not technically possible?

The full address causes problems. If the URL is changed in the editor, the link is generated. But if it is changed in the dashboard's list of articles, it will cause problems, even if the old address redirects to the new one, there will be a small jump. And if the permalinks are changed, the links in the table of contents will not work. Also, the full address doesn't work in preview mode, before the post is published. The link with only the anchor solved all these problems.

@t-hamano
Copy link
Contributor

t-hamano commented Jul 23, 2022

@t-hamano t-hamano added the [Block] Table of contents (experimental) Affects the Table of contents Block label Jul 23, 2022
@ricjcs
Copy link
Author

ricjcs commented Jul 23, 2022

Hi @t-hamano , thank you very much for your reply.

@t-hamano
Copy link
Contributor

@ricjcs

I'm glad you found it helpful.
I would like to close this issue, but if you have something to discuss, please re-opening it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table of contents (experimental) Affects the Table of contents Block
Projects
None yet
Development

No branches or pull requests

2 participants