-
Notifications
You must be signed in to change notification settings - Fork 56
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
Doc links are not consistent on path names #165
Comments
The Erlang docs are hosted on netlify that does "prettying" of URLs which means that among other things they strip the ".html" and seamlessly update all html links to not use it. However, the ExDoc sidebar is rendering using json, so the ".html" is not stripped there which is what you are seeing. We already do a pass updating the html generated by ExDoc to fix other issues, so also munging the json for the sidebar to strip the html should not be hard. I'm transferring this issue to the erlang.org repo as that is where the problem should be fixed. |
Having looked a bit closer it seems like it is ExDoc that does this, specifically the code in this file: https://github.com/elixir-lang/ex_doc/blob/v0.37.2/assets/js/sidebar/sidebar-list.js There seems to be quite a bit of code in there that assumes that we end in .html... I'll open an issue on ExDoc and see if anyone there can do something about it. |
hmm, having looked even closer at it, maybe this is an issue on our end... or rather with how netlify does rewrites of URLs... re-opening and I'll keep digging |
Thanks for looking into this @garazdawi! I'm trying to find the time to poke at this a bit more, but after my initial investigation not turning up anything obvious in configuration files, I was kinda lost as to what's happening and why. I can't look into it now, but you did make me wonder if hexdocs is doing something to hide this issue? I doubt it, but it's another difference between the erlang and elixir docs. |
It is netlify that is the source of the problem for us (and why hexdocs does not have any issue). What netlify does is that they rewrite all It is possible to disable the URL prettying logic in netlify... though it is a bit hard to predict what effects that will have... |
Ah, I see - the sidebar is generated client-side so Netlify doesn't have the chance to remove the |
Describe the bug
The sidebar and the content of the page use different paths for relative links. The sidebar uses
*.html#foo
, whereas links in the content use*#foo
(i.e., no.html
). This causes a roundtrip when using both, because the browser doesn't know they're the same page.To Reproduce
enif_alloc_binary()
erl_nif.html#enif_alloc_binary
enif_release_binary
link from the description ofenif_alloc_binary
erl_nif#enif_release_binary
erl_nif.html#foo
location fromerl_nif#bar
.Expected behavior
No round trip for locations in the same page.
Affected versions
Docs issue related to transition to ex_doc, I believe.
Additional context
I'm not sure exactly where or how the sidebar links are being generated. I think it's just an ex_doc configuration issue or something, since this isn't in hexdocs (I checked the Elixir docs on hexdocs).
The text was updated successfully, but these errors were encountered: