Skip to content

Conversation

matlc
Copy link

@matlc matlc commented Oct 27, 2018

As a potential solution for #730, this adds a check to create same-page anchors if the node is local.

For example, when on https://hexdocs.pm/elixir/Enum.html, the sidebar links under MODULES>Enum>Functions would be:

<a href="#fetch/2">fetch/2</a>

vs.

<a href="Enum.html#fetch/2">fetch/2</a>

I think this could help the visibility of on-page destinations in search engine's results.

Please let me know your thoughts on refactoring the check into a separate helper. I left it as is to be explicit about the check, however, it is a bit ugly.

@eksperimental
Copy link
Contributor

eksperimental commented Oct 27, 2018

Do you have any documentation that backs this assumption?

@matlc
Copy link
Author

matlc commented Oct 28, 2018

Unfortunately, not much at all. Having tried to research this, most discussions were around absolute vs relative urls, and had no discussion about anchor links.

I had thought of this as an actionable difference after comparing against other pages. I think it definitely isn't a 'full' solution, but thought it may help. I can close this if people don't think this would help or add very much.

Thanks for your suggestions in the issue thread!

@josevalim
Copy link
Member

@CRYIC shall we change this according to #922? Thank you!

@matlc
Copy link
Author

matlc commented Nov 11, 2018

@josevalim That sounds good. Time got away from me, but I've gotten a start on #922. For now, I'll close this PR and open a new one when that work is finished.

Thanks @eksperimental for suggesting and writing up the issue.

@matlc matlc closed this Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants