Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue: The breadcrumbs should link to the home page, but they currently link to the current page. The cause is that the `breadcrumbsField` function looks up the `"nav"` version of the parents, and then `indexlessUrlField` looks up their URL using `getRoute`, but the `"nav"` versions of the pages have no route. The fix is to use the default version of the parents instead. List of changes: 1. Remove now unused `"nav"` versions of the pages. I am guessing that the original reason for adding `"nav"` versions was to avoid a circular dependency (so that the message pages can link to the homepage which links to the messages). The dependency was introduced by the `load` function. But we can get the URL and title for the breadcrumbs without `load`. 2. Remove the `breadcrumbFields` function. On top of creating the "parents" field for the breadcrumbs, it adds a `messageTitleField` which appends the [GHC-XXXXXX] identifier. This was used in the messages pages and also the home page, where it just leaves the title unchanged. But that title was already available in `defaultContext`. Instead we add `messageTitleField` only in the messages pages and in the breadcrumbs (just in case, this is currently unused). 3. Simplify `breadcrumbCtx` to only get the url and title. 4. Refactor `indexlessUrlField` by reusing `urlField`. 5. Refactor `indexless` with an auxiliary `stripSuffix`. 6. Remove unused `breadcrumbField` in the `messages/examples/` pages.
- Loading branch information