Building up breadcrumbs from currently active path #2052
Unanswered
ricardobalk
asked this question in
Q&A
Replies: 1 comment
-
If the route is based on the file's Then loop over the code to query its path so as to find the file and get its title. const breadcrumbs = []
paths.forEach(path => {
const file = await queryContent().where({ _path: path}).find();
breadcrumbs.push({title: file.title, path: file._path})
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to use
contentQuery
together withuseRoute
in Nuxt Content to build a breadcrumb navigation menu?I.e., I am trying to get the parents of the currently active path. The only thing I got so far, was getting the children of the current path, but I want to do the opposite. See the example WIP code below:
Beta Was this translation helpful? Give feedback.
All reactions