Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

主题样式修改及增加功能 #829

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.idea
.DS_Store
node_modules/
dist/
npm-debug.log
selenium-debug.log
test/unit/coverage
test/e2e/reports
source/assets/
source/assets/
package-lock.json
24 changes: 18 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ subnav:
#google: "#"
#twitter: "#"
#linkedin: "#"

# 备案链接,根据实际要求填写,不需要的话留空或者注释即可
icp_link:
# 备案号
icp_code:
rss: /atom.xml

# 是否需要修改 root 路径
Expand All @@ -36,20 +39,22 @@ root: /
excerpt_link: more
# 文章卡片右下角常驻链接,不需要请设置为false
show_all_link: '展开全文'
fancybox: true
# 数学公式
mathjax: false
# 是否在新窗口打开链接
open_in_new: false

titlecase: false # 把标题转换为 titlecase(titlecase指的是将每个单词首字母转换成大写)
filename_case: 0 # 把文件名称转换为 (1) 小写或 (2) 大写, 0表示不变
# 打赏
# 打赏type设定:0-关闭打赏; 1-文章对应的md文件里有reward:true属性,才有打赏; 2-所有文章均有打赏
reward_type: 2
# 打赏wording
reward_wording: '谢谢你请我吃糖果'
# 支付宝二维码图片地址,跟你设置头像的方式一样。比如:/assets/img/alipay.jpg
alipay:
alipay:
# 微信二维码图片地址
weixin:
weixin:

# 目录
# 目录设定:0-不显示目录; 1-文章对应的md文件里有toc:true属性,才有目录; 2-所有文章均显示目录
Expand All @@ -73,7 +78,7 @@ avatar:
#是否开启分享
share_jia: true

#评论:1、多说;2、网易云跟帖;3、畅言;4、Disqus;5、Gitment
#评论:1、多说;2、网易云跟帖;3、畅言;4、Disqus;5、Gitment;6、自定义评论组件;
#不需要使用某项,直接设置值为false,或注释掉
#具体请参考wiki:https://github.com/litten/hexo-theme-yilia/wiki/

Expand All @@ -97,6 +102,11 @@ gitment_oauth:
client_id: '' #client ID
client_secret: '' #client secret

#6、自定义评论组件
custom_comment: false
# 评论管理的api接口
custom_comment_url: /blog/api

# 样式定制 - 一般不需要修改,除非有很强的定制欲望…
style:
# 头像上面的背景颜色
Expand All @@ -108,6 +118,8 @@ style:
slider:
# 是否默认展开tags板块
showTags: false
# 是否展示气泡动态效果
showAnm: false

# 智能菜单
# 如不需要,将该对应项置为false
Expand All @@ -127,4 +139,4 @@ friends:
友情链接5: http://localhost:4000/
友情链接6: http://localhost:4000/

aboutme: 很惭愧<br><br>只做了一点微小的工作<br>谢谢大家
aboutme: 很惭愧<br><br>只做了一点微小的工作<br>谢谢大家
31 changes: 16 additions & 15 deletions layout/_partial/after-footer.ejs
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<script>
var yiliaConfig = {
mathjax: <%=theme.mathjax%>,
isHome: <%=is_home()%>,
isPost: <%=is_post()%>,
isArchive: <%=is_archive()%>,
isTag: <%=is_tag()%>,
isCategory: <%=is_category()%>,
open_in_new: <%=theme.open_in_new%>,
toc_hide_index: <%=theme.toc_hide_index%>,
root: "<%=config.root%>",
innerArchive: <%=theme.smart_menu.innerArchive ? true : false%>,
showTags: <%=(theme.slider && theme.slider.showTags) ? true : false%>
}
var yiliaConfig = {
mathjax: <%=theme.mathjax%>,
isHome: <%=is_home()%>,
isPost: <%=is_post()%>,
isArchive: <%=is_archive()%>,
isTag: <%=is_tag()%>,
isCategory: <%=is_category()%>,
open_in_new: <%=theme.open_in_new%>,
toc_hide_index: <%=theme.toc_hide_index%>,
root: "<%=config.root%>",
innerArchive: <%=theme.smart_menu.innerArchive ? true : false%>,
showTags: <%=(theme.slider && theme.slider.showTags) ? true : false%>,
showAnm: <%=(theme.slider && theme.slider.showAnm) ? true : false%>
}
</script>

<%- partial('script') %>

<% if (theme.mathjax){ %>
<%- partial('mathjax') %>
<% } %>
<%- partial('mathjax') %>
<% } %>
9 changes: 7 additions & 2 deletions layout/_partial/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,20 @@
<%- partial('_partial/aside') %>


<% if (!index && post.comments){ %>
<% if (!index && post.comments) { %>

<% if (theme.custom_comment){ %>
<%- partial('post/custom') %>
<% } %>

<% if (theme.duoshuo){ %>
<%- partial('post/duoshuo', {
key: post.slug,
title: post.title,
url: config.url+url_for(post.path)
}) %>
<% } %>

<% if (theme.wangyiyun){ %>
<%- partial('post/wangyiyun', {
key: post.slug,
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/css.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<link rel="stylesheet" type="text/css" href="<%=config.root%>./main.0cf68a.css">
<link rel="stylesheet" type="text/css" href="<%=config.root%>./main.e28bb8.css">
43 changes: 36 additions & 7 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
<footer id="footer">
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&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
</div>
<div class="footer-left">
&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
</div>
</div>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="footer-center">
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<div id="busuanzi">
<span id="busuanzi_container_site_pv">本站总访问量:<span id="busuanzi_value_site_pv"></span></span>
</div>
<div id="icp_info">
<a href="<%= theme.icp_link %>" target="_blank"><%= theme.icp_code %></a>
</div>
<script src="https://cdn.bootcss.com/axios/0.19.0/axios.min.js"></script>
<script>
axios.post(`<%= theme.custom_comment_url %>/article/visitInfo`)

let rootUrl = '<%= theme.root %>'
if (rootUrl === location.pathname) {
let url = `${location.protocol}//${location.host}${rootUrl}content.json?t=${new Date().getTime()}`
axios.get(url).then(function (res) {
axios.request({
url: `<%= theme.custom_comment_url %>/article/allArticleInfo`,
method: 'post',
data: res.data
})
})
}
</script>
</div>
</div>
</footer>
</footer>
2 changes: 1 addition & 1 deletion layout/_partial/head.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="zh">
<head>
<meta charset="utf-8">
<%
Expand Down
Loading