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

Commit ef222b5

Browse files
committed
chore: update blog example
1 parent 97ba63e commit ef222b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+290
-16
lines changed

examples/blog/.vuepress/config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
// Path of the `entry page` (or `list page`)
1212
path: '/',
1313
pagination: {
14-
perPagePosts: 2,
14+
lengthPerPage: 2,
1515
},
1616
},
1717
],
@@ -21,10 +21,10 @@ module.exports = {
2121
keys: ['tag', 'tags'],
2222
path: '/tag/',
2323
layout: 'Tag',
24-
frontmatter: { title: 'Tags' },
24+
frontmatter: { title: 'Tag' },
2525
itemlayout: 'Tag',
2626
pagination: {
27-
perPagePosts: 2
27+
lengthPerPage: 3
2828
}
2929
},
3030
]

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div id="global-layout">
33
<header style="background-color: #DDD">
4-
<router-link to="/">Home</router-link>· <a href="/tag/">Tag</a>
4+
<router-link to="/">Home</router-link>· <router-link to="/tag/">Tag</router-link>
55
</header>
66
<DefaultGlobalLayout/>
77
<footer style="background-color: #DDD">Powered by VuePress</footer>
@@ -13,5 +13,8 @@
1313
1414
export default {
1515
components: { DefaultGlobalLayout: GlobalLayout },
16+
created() {
17+
console.log()
18+
}
1619
}
1720
</script>

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

+14
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,19 @@
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 />
1214
</div>
1315
</template>
16+
17+
<script>
18+
import Pagination from '../../../../../src/components/Pagination'
19+
20+
export default {
21+
components: { Pagination },
22+
created() {
23+
console.log(this.$route.meta.pid)
24+
console.log(this.$currentTag)
25+
}
26+
}
27+
</script>

examples/blog/_posts/2019-6-8-vueconf.md renamed to examples/blog/_posts/2019-6-10-vueconf.md

+1-1

examples/blog/_posts/2019-6-8-summary.md renamed to examples/blog/_posts/2019-6-11-summary.md

+1-1

examples/launch.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const { readdirSync, statSync } = require('fs')
2-
const { prompt } = require('inquirer')
32
const { fork } = require('child_process')
3+
const { prompt } = require('inquirer')
44

5-
const examples = readdirSync('examples')
6-
.filter(i =>
5+
const examples = readdirSync('examples').filter(
6+
i =>
77
!i.startsWith('.') &&
88
statSync(`${process.cwd()}/examples/${i}`).isDirectory(),
9-
)
9+
)
1010

1111
async function launch() {
1212
const { target } = await prompt([
@@ -32,14 +32,15 @@ async function launch() {
3232

3333
fork(
3434
require.resolve('vuepress/cli.js'),
35-
['dev',
35+
[
36+
'dev',
3637
`${process.cwd()}/examples/${target}`,
3738
'--temp',
3839
`examples/${target}/.temp`,
39-
...process.argv.slice(2)],
40+
...process.argv.slice(2),
41+
],
4042
{ stdio: 'inherit' },
4143
)
4244
}
4345

4446
launch()
45-

0 commit comments

Comments
 (0)