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

Relative links from external markdown files included in the docs are broken #324

Closed
toolness opened this issue Jun 29, 2017 · 1 comment
Closed

Comments

@toolness
Copy link
Contributor

While working on #321 I found that we have about 6 broken links in our docs that are due to including markdown files from the web-design-standards repo.

The original links are relative links to files in the repository which work fine when viewed on GitHub. For example, the page at https://standards.usa.gov/getting-started/code-guidelines/ is just the file https://github.com/18F/web-design-standards/blob/develop/CONTRIBUTING.md fetched and injected into our docs site. It includes a relative link to RELEASE.md, which works fine when viewed on github.com. However, the relative link breaks on standards.usa.gov because its relative URL turns into https://standards.usa.gov/getting-started/code-guidelines/RELEASE.md, which 404s.

I can think of two different solutions here:

  1. Ensure that all markdown files included from the other repository only have absolute links in them.
  2. Post-process the markdown files to automatically convert their relative URLs into absolute URLs based at github.com, so that they effectively point to the same place they do when viewed on github.

The first option doesn't require writing any code, but it's hard to ensure quality, unless we introduce a test case in the other repo that ensures no relative links exist in the markdown files.

The second option requires writing some ruby code.

Any preference @donjo?

@donjo
Copy link
Contributor

donjo commented Jun 29, 2017

I don't really have a preference though the second option seems a bit more future proof as teams turn over and new people have to take this on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants