diff --git a/.gitignore b/.gitignore index 0de4a2d..7052499 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ npm-debug.log* coverage package-lock.json yarn.lock +.idea/ diff --git a/components/Home.vue b/components/Home.vue index e2bce85..2e4cb42 100644 --- a/components/Home.vue +++ b/components/Home.vue @@ -1,17 +1,23 @@ + diff --git a/example/.vuepress/config.js b/example/.vuepress/config.js index 20766d8..dfe9321 100644 --- a/example/.vuepress/config.js +++ b/example/.vuepress/config.js @@ -2,9 +2,11 @@ const path = require('path') module.exports = { title: 'Example Site', + lang: 'zh-CN', description: 'Example for vuepress-theme-simple', theme: path.resolve(__dirname, '../../'), themeConfig: { author: 'viko16', + pageSize: 5, }, } diff --git a/example/2.md b/example/2.md new file mode 100644 index 0000000..c492e32 --- /dev/null +++ b/example/2.md @@ -0,0 +1,7 @@ +--- +title: Demo 2 - Hidden Post +date: 2020-03-25 +hide: true +--- + +This post will not generate in home list. diff --git a/example/3.md b/example/3.md new file mode 100644 index 0000000..f903773 --- /dev/null +++ b/example/3.md @@ -0,0 +1,7 @@ +--- +title: Demo 3 - Locked Post +date: 2020-03-25 +password: vuepress +--- + +This post need password to visit. diff --git a/example/4.md b/example/4.md new file mode 100644 index 0000000..dea1eff --- /dev/null +++ b/example/4.md @@ -0,0 +1,6 @@ +--- +title: page paginated test +date: 2020-03-25 +--- + +For page paginated test. diff --git a/example/5.md b/example/5.md new file mode 100644 index 0000000..dea1eff --- /dev/null +++ b/example/5.md @@ -0,0 +1,6 @@ +--- +title: page paginated test +date: 2020-03-25 +--- + +For page paginated test. diff --git a/example/6.md b/example/6.md new file mode 100644 index 0000000..dea1eff --- /dev/null +++ b/example/6.md @@ -0,0 +1,6 @@ +--- +title: page paginated test +date: 2020-03-25 +--- + +For page paginated test. diff --git a/example/7.md b/example/7.md new file mode 100644 index 0000000..dea1eff --- /dev/null +++ b/example/7.md @@ -0,0 +1,6 @@ +--- +title: page paginated test +date: 2020-03-25 +--- + +For page paginated test. diff --git a/index.js b/index.js index 581df5f..c541746 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,6 @@ module.exports = { - plugins: ['@vuepress/last-updated'] + plugins: [ + '@vuepress/last-updated', + '@vuepress/search' + ] } diff --git a/layouts/404.vue b/layouts/404.vue index dc60347..88717db 100644 --- a/layouts/404.vue +++ b/layouts/404.vue @@ -1,32 +1,62 @@ + + diff --git a/layouts/Layout.vue b/layouts/Layout.vue index 8117804..b630697 100644 --- a/layouts/Layout.vue +++ b/layouts/Layout.vue @@ -8,32 +8,64 @@ > {{ $site.title }} -
- +
+ +
- - - + + +
diff --git a/package.json b/package.json index 899159a..ea8741b 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ }, "dependencies": { "@vuepress/plugin-last-updated": "^1.2.0", + "@vuepress/plugin-search": "^1.2.0", "prismjs": "^1.19.0", "timeago.js": "^4.0.2" } diff --git a/styles/assets/night.svg b/styles/assets/night.svg new file mode 100644 index 0000000..479a146 --- /dev/null +++ b/styles/assets/night.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/styles/index.styl b/styles/index.styl index e3d201a..69e9d0c 100644 --- a/styles/index.styl +++ b/styles/index.styl @@ -339,3 +339,36 @@ div[class*='language-'] pre[class*='language-'] padding-left 3.5em + +.icon-night + position absolute + top -30px + right 5px + width 32px + height 32px + display inline-block + background-image embedurl('./assets/night.svg', 'utf8') + background-repeat no-repeat + background-position center + background-size 100% + vertical-align sub + +#searchBox + input + border-color #b3b3b3 + border none + background-color transparent + background-position-x 0 + border-radius 0 + + &:focus + border-bottom solid 1px #ddd + + ul + border-color #ddd + z-index 999 + left 0 + + li + a + color #888