gitalk评论

This commit is contained in:
结发受长生 2018-06-07 00:18:33 +08:00
parent c77caf259f
commit 5abf999657
12 changed files with 39 additions and 46 deletions

View File

@ -51,7 +51,7 @@ weixin:
# 目录
# 目录设定0-不显示目录; 1-文章对应的md文件里有toc:true属性才有目录 2-所有文章均显示目录
toc: 1
toc: 2
# 根据自己的习惯来设置如果你的目录标题习惯有标号置为true即可隐藏hexo重复的序号否则置为false
toc_hide_index: true
# 目录为空时的提示
@ -88,12 +88,15 @@ changyan_conf: false
#4、Disqus 在hexo根目录的config里也有disqus_shortname字段优先使用yilia的
disqus: false
#5、Gitment
gitment_owner: sookie2010 #你的 GitHub ID
gitment_repo: hexo_blog #存储评论的 repo
gitment_oauth:
client_id: 90e8f648da2a669f7975
client_secret: 7d2b602616387748ef0df10f7a8a626bdfd1034c
#5、gitalk
gitalk:
enable: true
ClientID: bede8dd783185299d256
ClientSecret: 91eaf4bf12a203793e3096aea07837812de32350
repo: hexo_blog
githubID: sookie2010
adminUser: sookie2010
distractionFreeMode: false
# 样式定制 - 一般不需要修改,除非有很强的定制欲望…
style:

View File

@ -1,5 +1,5 @@
<script>
var yiliaConfig = {
window.yiliaConfig = {
isHome: <%=is_home()%>,
isPost: <%=is_post()%>,
isArchive: <%=is_archive()%>,
@ -11,4 +11,21 @@ var yiliaConfig = {
showTags: <%=(theme.slider && theme.slider.showTags) ? true : false%>
}
</script>
<%- partial('script') %>
<%- partial('script') %>
<% if(theme.gitalk.enable && is_post()) { %>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<script>
(function(Gitalk){
new Gitalk({
clientID: '<%=theme.gitalk.ClientID%>',
clientSecret: '<%=theme.gitalk.ClientSecret%>',
repo: '<%=theme.gitalk.repo%>',
owner: '<%=theme.gitalk.githubID%>',
admin: ['<%=theme.gitalk.adminUser%>'],
id: decodeURI(location.pathname),
distractionFreeMode: <%=theme.gitalk.distractionFreeMode%>
}).render('gittalk-container')
})(Gitalk)
</script>
<% } %>

View File

@ -122,11 +122,7 @@
</section>
<% } %>
<% if (theme.gitment_owner && theme.gitment_repo &&theme.gitment_oauth && theme.gitment_oauth.client_id && theme.gitment_oauth.client_secret){ %>
<%- partial('post/gitment', {
key: post.slug,
title: post.title,
url: config.url+url_for(post.path)
}) %>
<% if(theme.gitalk.enable){ %>
<div id="gittalk-container" style="margin:0 30px"></div>
<% } %>
<% } %>

View File

@ -5,7 +5,7 @@
&copy; <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %>
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
Power By <a href="http://hexo.io/" target="_blank">Hexo</a>
</div>
</div>
</div>

View File

@ -1,16 +0,0 @@
<div id="gitment-ctn"></div>
<link rel="stylesheet" href="//imsun.github.io/gitment/style/default.css">
<script src="//imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
(function(){
new Gitment({
id: "<%=url%>",
owner: '<%=theme.gitment_owner%>',
repo: '<%=theme.gitment_repo%>',
oauth: {
client_id: '<%=theme.gitment_oauth.client_id%>',
client_secret: '<%=theme.gitment_oauth.client_secret%>'
}
}).render('gitment-ctn')
})()
</script>

View File

@ -1 +1 @@
<%- js('js/mobile.bc3ac97a4b2208729e1e.js') %> <%- js('js/slider.aa150152ad0b4e146925.js') %> <%- js('js/main.f26f0d0b8a2e2ae348ae.js') %>
<%- js('js/mobile.04379a910e1ff32f2a41.js') %> <%- js('js/slider.a725c75e59c2eeae98e0.js') %> <%- js('js/main.254cebd259c4777bdd2e.js') %>

View File

@ -10,7 +10,7 @@
<div id="wrapper" class="body-wrap">
<div class="menu-l">
<div class="canvas-wrap">
<canvas data-colors="#eaeaea" data-sectionHeight="100" data-contentId="js-content" id="myCanvas1" class="anm-canvas"></canvas>
<canvas data-colors="#eaeaea" data-sectionHeight="100" data-contentId="js-content" class="anm-canvas"></canvas>
</div>
<div id="js-content" class="content-ll">
<%- body %>

View File

@ -7497,11 +7497,6 @@
"indexof": "0.0.1"
}
},
"vue": {
"version": "2.5.16",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.5.16.tgz",
"integrity": "sha512-/ffmsiVuPC8PsWcFkZngdpas19ABm5mh2wA7iDqcltyCTwlgZjHGeJYOXkBMo422iPwIcviOtrTCUpSfXmToLQ=="
},
"watchpack": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",

View File

@ -45,8 +45,7 @@
"es6-promise": "^4.0.5",
"file-loader": "^0.9.0",
"js-cookie": "^2.1.3",
"photoswipe": "^4.1.1",
"vue": "^2.5.16"
"photoswipe": "^4.1.1"
},
"config": {
"commitizen": {

View File

@ -74,7 +74,6 @@ html, body, #container {
position: fixed;
width: 50px;
height: 50px;
top: -5px;
z-index: 4;
.slider-trigger{
position: absolute;
@ -88,8 +87,7 @@ html, body, #container {
left: 0;
}
&.list {
bottom: 0;
left: 0;
background-color: rgba(100,100,100,0.7)
}
&:hover{
background: #444;

View File

@ -32,7 +32,8 @@ function init() {
})
})
var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
index: parseInt(i)
index: parseInt(i),
bgOpacity: 0.8
});
gallery.init()
}

View File

@ -4,4 +4,4 @@
<% for (let chunk in htmlWebpackPlugin.files.chunks) { %>
<%= `${left} js('js/${chunk}.${htmlWebpackPlugin.files.chunks[chunk].hash}.js') ${right}${right2}` %>
<% } %>
<% } %>