rake icon indicating copy to clipboard operation
rake copied to clipboard

Fix broken links on ruby.github.io/rake home page

Open mattbrictson opened this issue 2 years ago • 0 comments

The homepage for Rake (https://ruby.github.io/rake/) has 4 broken links in the Rake Information section. Clicking them takes the user to a 404 page. The links point to .rdoc files that are transformed to _rdoc.html in the generated site. The links reference the original .rdoc names, so they don't work.

The links work when rendered on GitHub, however.

Ultimately the problem is that GitHub and rdoc generate these links differently. If the link is declared with the link: prefix (as they currently are), they work on GitHub, but break in the rendered rdoc site. On the other hand, if the link: prefix is removed, they work in the rdoc site but break on GitHub.

This commit applies a workaround to fix this. The source files are unchanged, but an additional build step has been added to the rdoc Rake task: after the site is generated, the broken links are detected and rewritten to have the correct names.

Because the source files have not been changed, the GitHub rendering will continue to work. This commit only affects the generated rdoc output, in order to fix the links.

mattbrictson avatar Aug 16 '23 21:08 mattbrictson