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

Commit 7350234

Browse files
committed
chore: update blog example
1 parent 7eb1ef4 commit 7350234

File tree

8 files changed

+27
-16
lines changed

8 files changed

+27
-16
lines changed

examples/blog/.vuepress/config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,22 @@ module.exports = {
2020
id: "tag",
2121
keys: ['tag', 'tags'],
2222
path: '/tag/',
23-
layout: 'Tag',
23+
// layout: 'Tag', defaults to `FrontmatterKey`.
2424
frontmatter: { title: 'Tag' },
25-
itemlayout: 'Tag',
2625
pagination: {
2726
lengthPerPage: 3
2827
}
2928
},
29+
{
30+
id: "location",
31+
keys: ['location'],
32+
path: '/location/',
33+
// layout: 'Location', defaults to `FrontmatterKey`.
34+
frontmatter: { title: 'Location' },
35+
pagination: {
36+
lengthPerPage: 5
37+
},
38+
}
3039
]
3140
}],
3241
],
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<ul id="default-layout">
3+
<li v-for="item in $frontmatterKey.list">
4+
<router-link class="page-link" :to="item.path">{{ item.name }}</router-link>
5+
</li>
6+
</ul>
7+
</template>

examples/blog/.vuepress/theme/layouts/GlobalLayout.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<template>
22
<div id="global-layout">
33
<header style="background-color: #DDD">
4-
<router-link to="/">Home</router-link>· <router-link to="/tag/">Tag</router-link>
4+
<router-link to="/">Home</router-link
5+
<router-link to="/tag/">Tag</router-link
6+
<router-link to="/location/">Location</router-link>
57
</header>
68
<DefaultGlobalLayout/>
79
<footer style="background-color: #DDD">Powered by VuePress</footer>

examples/blog/.vuepress/theme/layouts/Layout.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<router-link v-if="$pagination.hasPrev" :to="$pagination.prevLink">Prev</router-link>
1010
<router-link v-if="$pagination.hasNext" :to="$pagination.nextLink">Next</router-link>
1111
</div>
12-
13-
<Pagination/>
12+
13+
<Pagination v-if="$pagination.length > 1"/>
1414
</div>
1515
</template>
1616

@@ -19,9 +19,6 @@
1919
2020
export default {
2121
components: { Pagination },
22-
created() {
23-
console.log(this.$route.meta.pid)
24-
console.log(this.$currentTag)
25-
},
22+
created() {},
2623
}
2724
</script>

examples/blog/.vuepress/theme/layouts/Tag.vue

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/blog/_posts/2018-4-4-intro-to-vuepress.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
location: Hubei
23
tag:
34
- vue
45
- vuepress

examples/blog/_posts/2018-4-4-intro-to-vuepress的副本.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
location: Shanghai
23
tag:
34
- vue
45
- vuepress

examples/blog/_posts/2019-6-8-intro-to-vuepress-next.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
location: Hangzhou
23
tag:
34
- vue
45
- vuepress

0 commit comments

Comments
 (0)