This repository was archived by the owner on May 13, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 64
$pagination.pages contains extra page not in directory #32
Comments
If |
@Qwertovsky So if I have a directory object with |
@slanden Change both. |
@Qwertovsky Ah, thank you. Is this intended behavior? If so, maybe we can document this as a side note or something? |
18 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Steps to reproduce
I prepared a reproduction repo, here is the reproduction repo:
This issue doesn't need a reproduction repro, here is the steps to reproduce
npm i -D vuepress @vuepress/plugin-blog
"dev": "vuepress dev src"
src/.vuepress/theme/layouts
directory withLayout.vue
fileLayout.vue
add the following:config.js
with the following:src/posts/
directory with at least four test MD files. Four, because I set the pagination length to3
. They can be empty.npm run dev
/posts
Pagination
component$pagination.pages
/posts/page/2/
path: '/posts/'
topath: '/posts'
$pagination.pages
does not contain the extra page like beforeWhat is expected?
$pagination.pages is expected to only contain the pages that exist in the
/posts
directory.What is actually happening?
According to the docs, the trailing slash is correct. However, this seems to incorrectly add some sort of non-post page in the
$pagination.pages
array on the last pagination page.This is a problem because a blog index component, such as the one in the official blog theme, builds the list of posts by looping with
v-for="page in $pagination.pages"
.In the official theme, it's not as noticeable but it creates an empty "post" at the end. For me, I'm listing the posts in a card style and on the last page, I have this weird empty/garbage card at the end.
Other relevant information
npx vuepress info
:The text was updated successfully, but these errors were encountered: