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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mattbrictson
Copy link

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.

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.
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.

1 participant