8000 feat: page prev/next designs · Issue #849 · nuxtlabs/docus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: page prev/next designs #849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
atinux opened this issue Mar 10, 2023 — with Volta.net · 6 comments
Closed

feat: page prev/next designs #849

atinux opened this issue Mar 10, 2023 — with Volta.net · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

Copy link
Member
atinux commented Mar 10, 2023

I really like what Volta has done: https://volta.net/docs/get-started/install-with-github

https://volta.s3.fr-par.scw.cloud/Clean_Shot_2023_03_10_at_16_20_13_3e197bf3f8.mp4

We could set a default arrow icon if none is set for the previous/next page.

@atinux atinux added the enhancement New feature or request label Mar 10, 2023 — with Volta.net
Copy link
Contributor
bdrtsky commented Mar 10, 2023

it is beautiful 🤩
Not sure if current gray will look the same, tho

@electrolinux
Copy link
Contributor

About the DocsPrevNext.vue, I've noted this:

In the template, it call directory() with a string (prev._path):

    <span v-if="directory(prev._path)" class="directory">
          {{ directory(prev._path) }}
    </span>

And then in the directory function, this argument is named link, and then wrongly used (at that point, link._path is always undefined):

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

So I suggest to rename the directory argument path, and use it as is in the navDirFromPath() call.

I've also noted, after doing this change on my side, that when the nav[0]._path is returned (when the path is a folder and the first page is an index.md), this is the 'raw' path, starting with '/'.

So, here my proposal for the first 5 lines of the directory() function:

  const directory = (path: string) => {
    const nav = navDirFromPath(path, navigation.value || [])

    if (nav && nav[0]) {
      return nav[0]._path.split('/').filter(Boolean).map(upperFirst).join(' ')
    } else {
      // no other changes...
    }
  }

I could certainly provide a PR for this, but if someone is working on improving this component, it could be easily integrated.

(Hope this help)

Copy link
Member Author
atinux commented Mar 13, 2023

Thank you @electrolinux 🙏

cc @bdrtsky

Copy link
Contributor
bdrtsky commented Mar 15, 2023

awesome @electrolinux I will use this to improve PrevNext 👍

Copy link
Contributor
Tahul commented May 16, 2023

@bdrtsky ; have you included this inside #909 ? :)

@Tahul Tahul changed the title Improve previous and next page design feat: page prev/next designs May 16, 2023
Copy link
Contributor
bdrtsky commented May 17, 2023

@Tahul yes

@larbish larbish closed this as completed Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
0