erlang-org
erlang-org copied to clipboard
Background 404 error when loading documentation pages, online and local
Describe the bug
All documentation html tries to include docs_config.js but no such file exists.
To Reproduce
- Browse to https://www.erlang.org/doc/apps/stdlib/gen_statem
- Javascript console shows a 404 error and content-type mismatch for https://www.erlang.org/doc/apps/stdlib/docs_config.js
Expected behavior Should not see console errors.
Affected versions Master branch of online and local docs.
Additional context
- This seems to be something added in ExDoc v0.20, the file is supposed to provide a list of all software versions for the package being documented. It's automatically set correctly on hexdocs.pm, for example see https://hexdocs.pm/elixir/docs_config.js . Note that the file path is relative (so would need to be changed to absolute, or provided for every doc directory), and although it claims to be configurable it seems to be hardcoded in head_template.eex
- Example of creating the file manually: https://github.com/elixir-lang/ex_doc/blob/v0.37.3/mix.exs#L112
- It would be nice if the include could be disabled, at least… but being able to switch documentation versions would be even nicer!
- Some helpful discussion can be found in https://github.com/hexpm/hexpm/issues/795 , also interesting that the feature was originally configurable, this was removed in https://github.com/elixir-lang/ex_doc/commit/ceac52d13acbb871b8d068ffdff8330c6a641b06 , and added back hardcoded in https://github.com/elixir-lang/ex_doc/issues/1893 .
Transferred this to erlang-org repo as that is where the problem is.
When Erlang/OTP 28 is released, we plan to have a version dropdown for easy navigation between versions so that problem will go away when we implement that.