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 relative links #190

Merged
merged 2 commits into from
Oct 20, 2023
Merged

Fix broken relative links #190

merged 2 commits into from
Oct 20, 2023

Conversation

exoego
Copy link
Contributor

@exoego exoego commented Oct 20, 2023

Fixes #188

This PR consists of two fixes:

  1. dc004a4 Resolves all relative links in docs/features into full-path from the content root, on build time.
  2. ee43f67 Add trailing-slash in feature links on build time, so links work consistently on local and GitHub pages,

I think it is much easier to implement these fixes in this repo rather than in a separate repo (update_docs task).

This fix might be ugly, but it works as far as I tested.
I hope Middleman Ninja refactors someday.

@JonRowe
Copy link
Member

JonRowe commented Oct 20, 2023

Thanks, I was a bit apprehensive about this approach but it seems to work and means we can maintain the gherkin links in their repos.

For future travellers I tested this as follows:

  • Replicated the issue locally (you need a trailing slash to make the pages mess up)
  • Cherry-picked just the code commits
  • Ran my own build and removed some unrelated changes (CNAME, dates in feeds.xml)
  • Checked it fixed an originally reported issue
  • No diff to this PR so code is as generated by middleman
  • Ran the link checker which reports all links work (it did this before due to the lack of trailing slashes locally)

@exoego exoego deleted the fix-relative-links branch October 20, 2023 10:46
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

Successfully merging this pull request may close these issues.

Many relative links are broken (because Github Pages adds trailing slashes)
2 participants