nuxt-themes / docus

Write beautiful documentations with Nuxt and Markdown.
https://docus.dev
MIT License
1.54k stars 157 forks source link

prev, next should contain dir name/title #821

Open bdrtsky opened 1 year ago

bdrtsky commented 1 year ago

Right now for prev/next we have this:

const { prev, next, navigation } = useContent()

const directory = (link: any) => {
  const nav = navDirFromPath(link._path, navigation.value || [])

  if (nav && nav[0]) {
    return nav[0]._path
  } else {
    const dirs = link.split('/')
    const directory = dirs.length > 1 ? dirs[dirs.length - 2] : ''
    return directory.split('-').map(upperFirst).join(' ')
  }
}
Screenshot 2023-02-16 at 21 59 49

Instead of upperFirst it should know exactly which directory name (or title from yml) should be used

derHodrig commented 1 year ago

+1

Also would like to see that change. We habe a prefix q instead of Qmodule we want to show QModule. Works for Aside but not (as written above) for the prev and next button.

bdrtsky commented 1 year ago

@derHodrig this will be fixed in next major release, please wait a week or so 😉