Skip to content

Commit df0f498

Browse files
author
reco_luan
committed
feat: add vssue
package comments plugin, and use it to add vssue
1 parent 2506cd9 commit df0f498

File tree

8 files changed

+47
-122
lines changed

8 files changed

+47
-122
lines changed

components/Common.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Password v-if="!isHasPageKey" :isPage="true"></Password>
3131
<div v-else>
3232
<slot></slot>
33-
<Valine :isComment="isComment"></Valine>
33+
<Comments :isShowComments="isComment"/>
3434
</div>
3535
</div>
3636
</transition>
@@ -43,11 +43,10 @@ import Navbar from '@theme/components/Navbar.vue'
4343
import Sidebar from '@theme/components/Sidebar.vue'
4444
import { resolveSidebarItems } from '../util'
4545
import Password from '@theme/components/Password'
46-
import Valine from '@theme/components/Valine/'
4746
import { setTimeout } from 'timers'
4847
4948
export default {
50-
components: { Sidebar, Navbar, Password, Valine },
49+
components: { Sidebar, Navbar, Password },
5150
5251
props: ['sidebar', 'isComment'],
5352
@@ -185,6 +184,23 @@ export default {
185184
</script>
186185

187186
<style lang="stylus" scoped>
187+
.theme-container.no-sidebar
188+
.comments-wrapper
189+
padding-left 2rem
190+
191+
.comments-wrapper
192+
padding 2rem 2rem 2rem 22rem
193+
max-width: 740px;
194+
margin: 0 auto;
195+
@media (max-width: $MQNarrow)
196+
.theme-container.no-sidebar
197+
.comments-wrapper
198+
padding-left 2rem
199+
.comments-wrapper
200+
padding-left: 16.4rem;
201+
@media (max-width: $MQMobile)
202+
.comments-wrapper
203+
padding-left: 2rem
188204
.fade-enter-active, .fade-leave-active {
189205
transition: opacity .5s;
190206
}

components/Home.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,17 @@
5252
</a>
5353
</span>
5454
<span>
55-
<AccessNumber idVal="/"></AccessNumber>
55+
<AccessNumber idVal="/" />
5656
</span>
5757
</div>
5858
</div>
5959
</template>
6060

6161
<script>
6262
import NavLink from '@theme/components/NavLink/'
63-
import AccessNumber from '@theme/components/Valine/AccessNumber'
6463
6564
export default {
66-
components: { NavLink, AccessNumber },
65+
components: { NavLink },
6766
data () {
6867
return {
6968
recoShow: false

components/HomeBlog.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,18 @@
7171
</a>
7272
</span>
7373
<span>
74-
<AccessNumber idVal="/"></AccessNumber>
74+
<AccessNumber idVal="/" />
7575
</span>
7676
</div>
7777
</div>
7878
</template>
7979

8080
<script>
81-
import AccessNumber from '@theme/components/Valine/AccessNumber'
8281
import TagList from '@theme/components/TagList.vue'
8382
import NoteAbstract from '@theme/components/NoteAbstract.vue'
8483
8584
export default {
86-
components: { AccessNumber, NoteAbstract, TagList },
85+
components: { NoteAbstract, TagList },
8786
data () {
8887
return {
8988
recoShow: false,

components/PageInfo.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55
v-if="pageInfo.frontmatter.author || $themeConfig.author || $site.title">
66
<span>{{ pageInfo.frontmatter.author || $themeConfig.author || $site.title }}</span>
77
</i>
8-
<i class="iconfont reco-date" v-if="pageInfo.frontmatter.date"><span>{{ pageInfo.frontmatter.date | formatDate }}</span></i>
9-
<AccessNumber v-if="isHome !== true" :idVal="pageInfo.path" :numStyle="numStyle"></AccessNumber>
10-
<i class="iconfont reco-tag tags" v-if="pageInfo.frontmatter.tags">
8+
<i
9+
v-if="pageInfo.frontmatter.date"
10+
class="iconfont reco-date">
11+
<span>{{ pageInfo.frontmatter.date | formatDate }}</span>
12+
</i>
13+
<AccessNumber
14+
v-if="isHome !== true"
15+
:idVal="pageInfo.path"
16+
:numStyle="numStyle" />
17+
<i
18+
v-if="pageInfo.frontmatter.tags"
19+
class="iconfont reco-tag tags">
1120
<span
1221
v-for="(subItem, subIndex) in pageInfo.frontmatter.tags"
1322
:key="subIndex"
@@ -21,12 +30,10 @@
2130
</template>
2231

2332
<script>
24-
import AccessNumber from './Valine/AccessNumber'
2533
// 引入时间格式化js文件
2634
import { fromatDateTime } from '@theme/util/formatDate.js'
2735
2836
export default {
29-
components: { AccessNumber },
3037
// props: ['pageInfo', 'currentTag'],
3138
props: {
3239
pageInfo: {

components/Valine/AccessNumber.vue

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

components/Valine/index.vue

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

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ module.exports = (options, ctx) => ({
2323
'@vuepress-reco/pagation',
2424
'@vuepress-reco/screenfull',
2525
'@vuepress-reco/ga',
26+
['@vuepress-reco/comments', {
27+
solution: 'valine',
28+
options: {
29+
appId: 'Q6hMeY2PSaM9FMkXetzoJoU5-gzGzoHsz',
30+
appKey: 'iLQlev5jo2Cm5pLcI0z3qhtr',
31+
placeholder: '填写邮箱可以收到回复提醒哦!',
32+
notify: true,
33+
recordIP: true
34+
}
35+
}],
2636
'@vuepress/active-header-links',
2737
['@vuepress/plugin-blog', {
2838
permalink: '/:regular',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-theme-reco",
3-
"version": "1.0.9-alpha.11",
3+
"version": "1.0.9-alpha.12",
44
"description": "this is a vuepress theme",
55
"main": "index.js",
66
"scripts": {
@@ -31,6 +31,7 @@
3131
"@vuepress-reco/vuepress-plugin-pagation": "^1.0.3",
3232
"@vuepress-reco/vuepress-plugin-screenfull": "^1.0.0",
3333
"@vuepress-reco/vuepress-plugin-ga": "^1.0.2",
34+
"@vuepress-reco/vuepress-plugin-comments": "1.0.0-alpha.1",
3435
"@vuepress/plugin-blog": "1.3.0",
3536
"leancloud-storage": "3.13.2",
3637
"valine": "1.3.6",

0 commit comments

Comments
 (0)