harlan-zw / nuxt-seo

The complete SEO solution for Nuxt.
https://nuxtseo.com
MIT License
1.1k stars 70 forks source link

routeRules are ignored for breadcrumbs or causing wrong breadcrumbs #311

Closed geminigeek closed 2 months ago

geminigeek commented 2 months ago

Describe the bug

hi,

i have these route rules ,on pages like this http://192.168.1.8:3000/blog/tag/experiments i get , breadcrumbs like this remove route rules , everything works

routeRules: {
    "/blog/tag": { redirect: { to: "/blog/tags", statusCode: 301 } },
}

Breadcrumbs

Home
Blog
/Blog/tag
Experiments
[
  {
    "to": "/",
    "label": "Home",
    "ariaLabel": "Home",
    "current": false
  },
  {
    "to": "/blog",
    "label": "Blog",
    "ariaLabel": "Blog",
    "current": false
  },
  {
    "to": "/blog/tag",
    "label": "/Blog/tag",
    "ariaLabel": "/Blog/tag",
    "current": false
  },
  {
    "to": "/blog/tag/dd",
    "label": "Dd",
    "ariaLabel": "Dd",
    "current": true
  }
]

in reproduction visit this url https://gqairmgblwgithub-c5kt--3000--24eaa195.local-credentialless.webcontainer.io/blog/tag/dd enable/ disable route rules in nuxt.config.ts to see the issue

Reproduction

https://stackblitz.com/edit/github-tsj5bt?file=pages%2Fblog%2Ftag%2F[slug].vue,nuxt.config.ts,app.vue,pages%2Findex.vue

System / Nuxt Info

No response

harlan-zw commented 2 months ago

Hi, thank you for the reproduction. I've pushed up a fix that will be in the next RC.