Skip to content

Commit

Permalink
feat: add waline comment plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
simon1uo committed Jul 3, 2022
1 parent c4cab7c commit 15f9acd
Show file tree
Hide file tree
Showing 9 changed files with 37,033 additions and 35,671 deletions.
60 changes: 36 additions & 24 deletions docs/.vuepress/config/head.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
import { HeadTags } from 'vuepress/config'

export default <HeadTags>[
['link', { rel: 'icon', href: '/favicon.ico' }], //站点图标, 默认为 public/favicon.ico
[
'meta',
{
name: 'viewport',
content: 'width=device-width,initial-scale=1,user-scalable=no'
}
],
[
'meta',
{
name: 'keywords',
content:
'个人学习笔记,前端学习笔记,前端学习,前端学习资源,前端学习路线,HTML,CSS,JavaScript,Vue,React'
}
],
['meta', { name: 'theme-color', content: '#204A7A' }],
[
'link',
{
rel: 'stylesheet',
href: '//at.alicdn.com/t/font_3114978_qe0b39no76.css'
}
]
['link', { rel: 'icon', href: '/favicon.ico' }], //站点图标, 默认为 public/favicon.ico
[
'meta',
{
name: 'viewport',
content: 'width=device-width,initial-scale=1,user-scalable=no'
}
],
[
'meta',
{
name: 'keywords',
content:
'个人学习笔记,前端学习笔记,前端学习,前端学习资源,前端学习路线,HTML,CSS,JavaScript,Vue,React'
}
],
['meta', { name: 'theme-color', content: '#204A7A' }],
[
'link',
{
rel: 'stylesheet',
href: '//at.alicdn.com/t/font_3114978_qe0b39no76.css'
}
],
['link',
{
rel: 'stylesheet',
href: 'https://unpkg.com/@waline/client@v2/dist/waline.css'
}
],
[
'script',
{
src: 'https://unpkg.com/@waline/client@v2/dist/waline.js'
}
]
]
61 changes: 30 additions & 31 deletions docs/.vuepress/config/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,36 @@
import { NavItem } from 'vuepress/config'

export default <Array<NavItem>>[
{
text: '🌏 首页',
link: '/'
},
{
text: '☕️ 前端笔记',
link: '/front-end/',
{
text: '🌏 首页',
link: '/'
},
{
text: '☕️ 前端笔记',
link: '/front-end/',
items: [
{ text: '🗺 前端学习路线', link: '/front-end/roadmap/' },
{
text: '分类',
items: [
{ text: '🗺 前端学习路线', link: '/front-end/roadmap/' },
{
text: '分类',
items: [
{ text: '🚶 前端入门基础', link: '/front-end/beginning/' },
{ text: '🚶🏻 前端巩固基础', link: '/front-end/stable/' },
{ text: '🏃 前端核心框架', link: '/front-end/core-frame/' }
]
}
{ text: '🚶 前端入门基础', link: '/front-end/beginning/' },
{ text: '🚶🏻 前端巩固基础', link: '/front-end/stable/' },
{ text: '🏃 前端核心框架', link: '/front-end/core-frame/' },
{ text: '🪞 前端面试题收集', link: 'front-end/interview'}
]
},
{
text: '🔖 关于',
link: '/about/',
items: [
{
text: '🚏索引',
link: '/archives/',
items: [
{ text: '🗄归档', link: '/archives/' },
{ text: '🔖标签', link: '/tags/' }
]
}
]
}
}
]
},
{
text: '🚏 索引',
link: '/archives/',
items: [
{ text: '🗄归档', link: '/archives/' },
{ text: '🔖标签', link: '/tags/' }
]
},
{
text: '🔖 关于',
link: '/about/',
}
]
123 changes: 69 additions & 54 deletions docs/.vuepress/config/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,76 @@ import fs from 'fs'
// @ts-ignore
import dayjs from 'dayjs'
import { resolve } from 'path'
import type { SmPlayerPluginOption } from 'vuepress-plugin-smplayer/types'


// 配置插件,推荐使用 Babel 式, 根据自己插件情况修改插件配置
export default <UserPlugins>[
// [
// 'sitemap',
// {
// hostname: `https://${fs.readFileSync(
// resolve(__dirname, '../public', 'CNAME')
// )}`
// }
// ],
['pangu'],
[
'one-click-copy',
{
copySelector: [
'div[class*="language-"] pre',
'div[class*="aside-code"] aside'
],
copyMessage: '复制成功',
duration: 1000,
showInMobile: false
}
],
[
'zooming',
{
selector: '.theme-vdoing-content img:not(.no-zoom)', // 排除class是no-zoom的图片
options: {
bgColor: 'rgba(0,0,0,0.6)'
}
}
],
['fulltext-search'],
[
'demo-block', // demo演示模块 https://github.com/xiguaxigua/vuepress-plugin-demo-block
{
settings: {
// jsLib: ['http://xxx'], // 在线示例(jsfiddle, codepen)中的js依赖
// cssLib: ['http://xxx'], // 在线示例中的css依赖
vue: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖
jsfiddle: true, // 是否显示 jsfiddle 链接
codepen: true, // 是否显示 codepen 链接
horizontal: false // 是否展示为横向样式
}
}
],
[
'@vuepress/last-updated', // "上次更新"时间格式
{
transformer: (timestamp, lang) => {
return dayjs(timestamp).format('YYYY/MM/DD, HH:mm:ss')
}
}
],
['@vuepress/nprogress']
// [
// 'sitemap',
// {
// hostname: `https://${fs.readFileSync(
// resolve(__dirname, '../public', 'CNAME')
// )}`
// }
// ],
['pangu'],
[
'one-click-copy',
{
copySelector: [
'div[class*="language-"] pre',
'div[class*="aside-code"] aside'
],
copyMessage: '复制成功',
duration: 1000,
showInMobile: false
}
],
[
'zooming',
{
selector: '.theme-vdoing-content img:not(.no-zoom)', // 排除class是no-zoom的图片
options: {
bgColor: 'rgba(0,0,0,0.6)'
}
}
],
['fulltext-search'],
[
'demo-block', // demo演示模块 https://github.com/xiguaxigua/vuepress-plugin-demo-block
{
settings: {
// jsLib: ['http://xxx'], // 在线示例(jsfiddle, codepen)中的js依赖
// cssLib: ['http://xxx'], // 在线示例中的css依赖
vue: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖
jsfiddle: true, // 是否显示 jsfiddle 链接
codepen: true, // 是否显示 codepen 链接
horizontal: false // 是否展示为横向样式
}
}
],
[
'@vuepress/last-updated', // "上次更新"时间格式
{
transformer: (timestamp, lang) => {
return dayjs(timestamp).format('YYYY/MM/DD, HH:mm:ss')
}
}
],
['@vuepress/nprogress'],
[
'vuepress-plugin-comment-plus',
{
choosen: 'waline',
// options选项中的所有参数,会传给Waline的配置
options: {
el: '#valine-vuepress-comment',
serverURL: 'https://waline-comment-container-rjrabjk7j-simon1uo.vercel.app/',
path: '<%- frontmatter.permalink %>',
dark: 'body.theme-mode-dark',
login: 'force',
emoji: ['//unpkg.com/@waline/[email protected]/alus', '//unpkg.com/@waline/[email protected]/tw-emoji']
}
}
]
]
2 changes: 1 addition & 1 deletion docs/.vuepress/config/themeVdoingConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ export default <VdoingThemeConfig>{

footer: {
createYear: 2020, // 博客创建年份
copyrightInfo: ''
copyrightInfo: 'wrote with ❤️ by <a href="https://simon1uo.github.io">Simon</a></br>'
}
}
Loading

0 comments on commit 15f9acd

Please sign in to comment.