Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit eab7fdd

Browse files
committed
fix: bump blog plugin to 1.2.1 fix filter bug
1 parent 490e072 commit eab7fdd

File tree

7 files changed

+20
-14
lines changed

7 files changed

+20
-14
lines changed

example/.vuepress/config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ module.exports = {
2424
text: 'Tags',
2525
link: '/tag/',
2626
},
27+
{
28+
text: 'About',
29+
link: '/about/',
30+
},
2731
],
2832
/**
2933
* Ref: https://vuepress-theme-blog.ulivz.com/#footer

example/about.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# About Me

global-components/BaseListLayout.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121
</div>
2222

23-
<component v-if="paginationComponent" :is="paginationComponent"></component>
23+
<component v-if="$pagination.length > 1 && paginationComponent" :is="paginationComponent"></component>
2424
</div>
2525
</template>
2626

@@ -30,12 +30,10 @@
3030
import Toc from '@theme/components/Toc.vue'
3131
import { NavigationIcon, ClockIcon } from 'vue-feather-icons'
3232
import { Pagination, SimplePagination } from '@vuepress/plugin-blog/lib/client/components'
33-
34-
console.log(SimplePagination)
35-
33+
3634
export default {
3735
components: { Toc, Pagination, NavigationIcon, ClockIcon },
38-
props: ['pagination'],
36+
// props: ['pagination'],
3937
data() {
4038
return {
4139
paginationComponent: null
@@ -48,7 +46,8 @@
4846
4947
computed: {
5048
pages() {
51-
return this.pagination.pages
49+
console.log(this.$pagination)
50+
return this.$pagination.pages
5251
},
5352
},
5453

index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = (themeConfig, ctx) => {
1717
id: 'post',
1818
dirname: '_posts',
1919
path: '/',
20-
layout: 'IndexPost',
20+
// layout: 'IndexPost', defaults to `Layout.vue`
2121
itemLayout: 'Post',
2222
itemPermalink: '/:year/:month/:day/:slug',
2323
pagination: {
@@ -28,7 +28,7 @@ module.exports = (themeConfig, ctx) => {
2828
id: 'archive',
2929
dirname: '_archive',
3030
path: '/archive/',
31-
layout: 'IndexArchive',
31+
// layout: 'IndexArchive', defaults to `Layout.vue`
3232
itemLayout: 'Post',
3333
itemPermalink: '/archive/:year/:month/:day/:slug',
3434
pagination: {
@@ -41,11 +41,10 @@ module.exports = (themeConfig, ctx) => {
4141
id: "tag",
4242
keys: ['tag', 'tags'],
4343
path: '/tag/',
44-
layout: 'Tag',
44+
// layout: 'Tag', defaults to `FrontmatterKey.vue`
4545
frontmatter: { title: 'Tag' },
46-
itemlayout: 'Tag',
4746
pagination: {
48-
perPagePosts: 5
47+
lengthPerPage: 5
4948
}
5049
},
5150
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
22
<div id="vuperess-theme-blog__tags-layout">
3-
<BlogTags :tags="$tag.list"/>
3+
<BlogTags :tags="$frontmatterKey.list"/>
44
</div>
55
</template>

layouts/Layout.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<BaseListLayout :pagination="$pagination"/>
2+
<div>
3+
<BaseListLayout v-if="$pagination"/>
4+
<Content v-else/>
5+
</div>
36
</template>
47

58
<style src="prismjs/themes/prism-okaidia.css"></style>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"author": "ulivz<[email protected]>",
2828
"license": "MIT",
2929
"dependencies": {
30-
"@vuepress/plugin-blog": "1.1.0",
30+
"@vuepress/plugin-blog": "1.2.1",
3131
"@vuepress/plugin-medium-zoom": "1.0.0",
3232
"@vuepress/plugin-nprogress": "1.0.0",
3333
"@vuepress/plugin-pwa": "1.0.0",

0 commit comments

Comments
 (0)