Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xugaoyi committed May 21, 2020
1 parent b7ce880 commit 3591d72
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 18 deletions.
10 changes: 9 additions & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module.exports = {
},
footer:{ // 页脚信息
createYear: 2019, // 博客创建年份
copyrightInfo: 'Evan Xu | MIT License', // 博客版权信息,支持a标签
copyrightInfo: 'Evan Xu | <a href="https://github.com/xugaoyi/vuepress-theme-vdoing/blob/master/LICENSE" target="_blank">MIT License</a>', // 博客版权信息,支持a标签
}
},
plugins: [ // 插件
Expand Down Expand Up @@ -153,6 +153,14 @@ module.exports = {
],
[
'vuepress-plugin-comment', // 评论
// {
// choosen: 'valine',
// options: {
// el: '#valine-vuepress-comment',
// appId: 'Your own appId',
// appKey: 'Your own appKey'
// }
// }
{
choosen: 'gitalk',
options: {
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/styles/palette.styl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// $lineNumbersWrapperWidth = 2.5rem

// // 浅色模式
// body,.theme-mode-light
// .theme-mode-light
// --bodyBg: #f4f4f4
// --mainBg: rgba(255,255,255,1)
// --sidebarBg: rgba(255,255,255,.8)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"vuepress-plugin-one-click-copy": "^1.0.2",
"vuepress-plugin-thirdparty-search": "^1.0.2",
"vuepress-plugin-zooming": "^1.1.7",
"vuepress-theme-vdoing": "^1.0.0-beta.9",
"vuepress-theme-vdoing": "^1.0.0",
"yamljs": "^0.3.0"
},
"dependencies": {
Expand Down
28 changes: 15 additions & 13 deletions theme-vdoing/components/Buttons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export default {
_scrollTimer: null,
_textareaEl: null,
_recordScrollTop: null,
COMMENT_SELECTOR: '#vuepress-plugin-comment' // 评论区元素的选择器
COMMENT_SELECTOR_1: '#vuepress-plugin-comment', // 评论区元素的选择器1
COMMENT_SELECTOR_2: '#valine-vuepress-comment', // 评论区元素的选择器2
COMMENT_SELECTOR_3: '.vssue' // 评论区元素的选择器3
}
},
mounted () {
Expand All @@ -88,7 +90,7 @@ export default {
this.scrollTop = this.getScrollTop()
}, 100))
this.handleShowCommentBut()
// this.handleShowCommentBut()
window.addEventListener('load', () => {
this.getCommentTop()
})
Expand Down Expand Up @@ -129,22 +131,21 @@ export default {
getCommentTop () {
setTimeout(() => {
const commentEl = document.querySelector(this.COMMENT_SELECTOR)
let commentEl = document.querySelector(this.COMMENT_SELECTOR_1) || document.querySelector(this.COMMENT_SELECTOR_2) || document.querySelector(this.COMMENT_SELECTOR_3)
if (commentEl) {
this.commentTop = commentEl.offsetTop
} else {
this.showCommentBut = false
this.showCommentBut = this.$frontmatter.comment !== false && this.$frontmatter.home !== true
this.commentTop = commentEl.offsetTop - 58
}
},500)
},
handleShowCommentBut() {
this.showCommentBut = this.$frontmatter.comment !== false && this.$frontmatter.home !== true
},
// handleShowCommentBut() {
// // this.showCommentBut = this.$frontmatter.comment !== false && this.$frontmatter.home !== true
// },
scrollToComment() {
window.scrollTo({ top: this.commentTop, behavior: 'smooth' })
this._textareaEl = document.querySelector(this.COMMENT_SELECTOR + ' textarea')
this._textareaEl = document.querySelector(this.COMMENT_SELECTOR_1 + ' textarea') || document.querySelector(this.COMMENT_SELECTOR_2 + ' input') || document.querySelector(this.COMMENT_SELECTOR_3 + ' textarea')
if( this._textareaEl && this.getScrollTop() !== this._recordScrollTop) {
document.addEventListener("scroll", this._handleListener)
} else if (this._textareaEl && this.getScrollTop() === this._recordScrollTop) {
Expand All @@ -171,7 +172,7 @@ export default {
},
watch: {
'$route.path'() {
this.handleShowCommentBut()
// this.handleShowCommentBut()
this.getCommentTop()
}
}
Expand All @@ -180,8 +181,9 @@ export default {

<style lang='stylus'>
.yellowBorder
border: #FFE089 1px solid!important
box-shadow 0 0 10px #FFE089!important
// border: #FFE089 1px solid!important
border-radius 5px
box-shadow 0 0 15px #FFE089!important
.buttons
position fixed
right 2rem
Expand Down
2 changes: 1 addition & 1 deletion theme-vdoing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuepress-theme-vdoing",
"version": "1.0.0-beta.9",
"version": "1.0.0",
"description": "Vdoing theme for VuePress. 一个基于VuePress的知识管理兼博客主题。",
"author": {
"name": "gaoyi(Evan) Xu"
Expand Down
2 changes: 1 addition & 1 deletion theme-vdoing/styles/palette.styl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $rightMenuWidth = 230px // 右侧菜单
$lineNumbersWrapperWidth = 2.5rem

// 浅色模式
body,.theme-mode-light
.theme-mode-light
--bodyBg: #f4f4f4
--mainBg: rgba(255,255,255,1)
--sidebarBg: rgba(255,255,255,.8)
Expand Down
11 changes: 11 additions & 0 deletions theme-vdoing/templates/dev.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title></title>
</head>
<body class="theme-mode-light">
<div id="app"></div>
</body>
</html>
17 changes: 17 additions & 0 deletions theme-vdoing/templates/ssr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="{{ lang }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{{ title }}</title>
<meta name="generator" content="VuePress {{ version }}">
{{{ userHeadTags }}}
{{{ pageMeta }}}
{{{ renderResourceHints() }}}
{{{ renderStyles() }}}
</head>
<body class="theme-mode-light">
<!--vue-ssr-outlet-->
{{{ renderScripts() }}}
</body>
</html>

0 comments on commit 3591d72

Please sign in to comment.