x-govuk / govuk-eleventy-plugin

Write documentation using Markdown and publish it using GOV.UK styles.
https://x-govuk.github.io/govuk-eleventy-plugin/
MIT License
53 stars 13 forks source link

Weird issue with ‘nodes’ within the breadcrumb getting mixed up #139

Open adamsilver opened 1 year ago

adamsilver commented 1 year ago

https://cln.sh/R0CwRDGx

paulrobertlloyd commented 1 year ago

Hmmm, Eleventy’s navigation plugin is typically more convoluted and prone to breaking/errors than I’d like. It’s based on the concept of key names, which themselves are taken from page titles.

I think it might be possible to explicitly declare a parent node’s key name in this case… I’ll take a look and see if there’s a way to solve this already. If there is, I’ll update the documentation. If not, I’ll look at a way we can avoid this happening.

vickytnz commented 1 month ago

I've also experienced this issue when trying to create a site that will hopefully be part of the x-gov family. The home page doesn't act as expected on the homepage with the subsite - the breadcrumb is showing up for the current page and when I try to turn it off weird things happen.

On a check, this is also an issues with the plugin page itself

home page with breadcrumbs

In this example the 'GOV.UK eleventy plugin' breadcrumb shouldn't be there (and it's causing a lot of repetition on the page).

I managed to hack this by making a template and putting everything into it

breadcrumbs: {
        classes: "govuk-!-display-none-print",
        items: [
            {
              text: options.parentSite.name,
              href: options.parentSite.url
            }
            ]
     }