Open hermesalvesbr opened 1 year ago
I would be nice to generate breadcrumb in json ld format based on content structure. In the same way we have dynamic navigation
Et voilà
const {page} = useContent()
const breadcrumbs = []
const pagePathExploded = page.value._path.split('/')
let tmpPagePath = ''
for (const pagePathItem of pagePathExploded) {
if (pagePathItem === '') continue
tmpPagePath += `/${pagePathItem}`
breadcrumbs.push(await queryContent(tmpPagePath).only(['title', '_path']).findOne())
}
console.log(breadcrumbs)
Anyway yes, having a content helper for this would be helpful but it's probably better to build your own function
that's what i looking for!
Is your feature request related to a problem? Please describe
Today to make a breadcrumbs nav is complex, because in my language the words have special characters.
Describe the solution you'd like
If the composable navigation had a breadcrumbs object it would solve this.
Describe alternatives you've considered
Today we use packages that have integration with nuxt, but there is nothing for nuxt content 2.
Additional context
A simple breadcrumbs can also be used to assemble menus, logic of what the user has already visited and what remains to be visited.