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

yilia功能扩展,修改某些样式 #767

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
### 我做出的一些修改

fix:reward-btn to square

fix:social github & weibo icon color

add:为mobile avatar添加主页跳转链接

add:post-copyright

fix:去掉文章摘要下的more,仅保留文章摘要的展开全文

fix:表头与单元格对齐方式不一致

add:baidu-push

add:livere评论系统

live preview:[https://liziczh.com](https://liziczh.com)

以下为原文

---

hexo-theme-yilia
================

Expand Down Expand Up @@ -37,15 +61,15 @@ Yilia 是为 [hexo](https://github.com/tommy351/hexo) 2.4+制作的主题。

## 一、外观

####**常规**
#### **常规**

![常规](https://cloud.githubusercontent.com/assets/2024949/19027861/92879edc-8967-11e6-8e60-7987b6507c8d.gif)

####**手机**
#### **手机**

![手机](https://cloud.githubusercontent.com/assets/2024949/19027020/1c5b756a-895f-11e6-99bf-ddff9687aee0.gif)

####**ipad横竖屏切换**
#### **ipad横竖屏切换**

![ipad横竖屏切换](https://cloud.githubusercontent.com/assets/2024949/19026392/e74e1816-8957-11e6-8f08-eac9b3c8c036.gif)

Expand Down
10 changes: 10 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ alipay:
# 微信二维码图片地址
weixin:

# 版权声明
# 版权声明type设定:0-关闭版权声明; 1-文章对应的md文件里有copyright: true属性,才有版权声明; 2-所有copyright不为false的文章均有版权声明
copyright_type: 2

# 目录
# 目录设定:0-不显示目录; 1-文章对应的md文件里有toc:true属性,才有目录; 2-所有文章均显示目录
toc: 1
Expand All @@ -62,6 +66,9 @@ toc_empty_wording: '目录,不存在的…'
# 是否有快速回到顶部的按钮
top: true

# 百度推送
baidu_push: true

# Miscellaneous
baidu_analytics: ''
google_analytics: ''
Expand All @@ -77,6 +84,9 @@ share_jia: true
#不需要使用某项,直接设置值为false,或注释掉
#具体请参考wiki:https://github.com/litten/hexo-theme-yilia/wiki/

#0、liveRe
livere_uid: false

#1、多说
duoshuo: false

Expand Down
29 changes: 29 additions & 0 deletions layout/_partial/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,26 @@
</a>
</div>
<% } %>

<% if (((theme.copyright_type === 2 && !post.copyright) || (theme.copyright_type === 1 && post.copyright)) && !index){ %>
<div>
<ul class="post-copyright">
<li>
<strong>本文作者:</strong>
<%= config.author%>
</li>
<li>
<strong>本文链接:</strong>
<a href="<%= config.url %><%- url_for(post.path) %>" title="<%= config.title %>"><%= config.url %><%- url_for(post.path) %></a>
</li>
<li>
<strong>版权声明: </strong>
本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> 许可协议。转载请注明出处!
</li>
</ul>
</div>
<% } %>

</div>
<div class="article-info article-info-index">
<%if(post.top){%>
Expand Down Expand Up @@ -80,6 +100,15 @@


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

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

<% if (theme.duoshuo){ %>
<%- partial('post/duoshuo', {
key: post.slug,
Expand Down
16 changes: 16 additions & 0 deletions layout/_partial/baidu-push.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<% if (theme.baidu_push){ %>
<script>
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
}
else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
<% } %>
1 change: 1 addition & 0 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@
</style>
<%- partial('google-analytics') %>
<%- partial('baidu-analytics') %>
<%- partial('baidu-push') %>
</head>
2 changes: 1 addition & 1 deletion layout/_partial/mobile-nav.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="intrude-less">
<header id="header" class="inner">
<div class="profilepic">
<img src="<%=theme.avatar%>" class="js-avatar">
<a href="/"><img src="<%=theme.avatar%>" class="js-avatar"></a>
</div>
<hgroup>
<h1 class="header-author js-header-author"><%=theme.author%></h1>
Expand Down
17 changes: 17 additions & 0 deletions layout/_partial/post/livere.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- 来必力City版安装代码 -->
<div id="lv-container" data-id="city" data-uid="<%=theme.livere_uid%>">
<script type="text/javascript">
(function(d, s) {
var j, e = d.getElementsByTagName(s)[0];

if (typeof LivereTower === 'function') { return; }

j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;

e.parentNode.insertBefore(j, e);
})(document, 'script');
</script>
</div>
<!-- City版安装代码已完成 -->
1 change: 1 addition & 0 deletions source-src/css/article.scss
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
td,th{
border: 1px solid #dedede;
padding: 0 10px;
text-align: left;
}
}
figure{
Expand Down
2 changes: 1 addition & 1 deletion source-src/css/mobile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ html, body, #container {
margin: 0;
}
.article-entry{
padding: 10px 0 30px 0;
padding: 10px 0 0 0;
}
.article-inner h1.article-title, .article-title{
font-size: 18px;
Expand Down
19 changes: 7 additions & 12 deletions source-src/css/reward.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
.page-reward-btn {
position: relative;
display: inline-block;
width: 56px;
height: 56px;
line-height: 56px;
font-size: 20px;
color: #fff;
background: #f44336;
border-radius: 50%;
border-radius: 8%;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
-webkit-transition: .4s ease-in-out;
transition: .4s ease-in-out;
Expand All @@ -19,8 +16,9 @@
}
.tooltip-item {
display: block;
width: 56px;
height: 56px;
width: 100px;
height: 40px;
line-height: 40px;
}
}
.reward-box {
Expand All @@ -30,7 +28,7 @@
.reward-p {
color: #fff;
font-weight: bold;
text-shadow: 1px 1px 1px #45b9e0;
text-shadow: 1px 1px 1px #4d4d4d;
.icon {
margin: 0 10px;
color: #ddd;
Expand All @@ -39,13 +37,10 @@
.reward-type {
font-size: 16px;
display: block;
color: #4d4d4d;
color: #fff;
margin: 20px 0 0 0;
}
.reward-img {
width: 130px;
height: 130px;
border: 6px solid #fff;
border-radius: 3px;
width: 180px;
}
}
12 changes: 6 additions & 6 deletions source-src/css/social.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
}
}
a.weibo {
background: #aaaaff;
border:1px solid #aaaaff;
background: #ffa111;
border:1px solid #ffa111;
&:hover {
border:1px solid #aaaaff;
border:1px solid #ffa111;
}
}
a.segmentfault {
Expand All @@ -50,10 +50,10 @@
}
}
a.github {
background: #afb6ca;
border:1px solid #afb6ca;
background: #000;
border:1px solid #000;
&:hover {
border:1px solid #909ab6;
border:1px solid #000;
}
}
a.facebook {
Expand Down
6 changes: 3 additions & 3 deletions source-src/css/tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
.tooltip-content {
position: absolute;
z-index: 9999;
width: 370px;
width: 480px;
left: 50%;
bottom: 100%;
font-size: 20px;
Expand All @@ -147,7 +147,7 @@
color: #4d4d4d;
background: transparent;
opacity: 0;
margin: 0 0 -10px -185px;
margin: 0 0 -20px -240px;
cursor: default;
pointer-events: none;
font-family: 'Satisfy', cursive;
Expand Down Expand Up @@ -185,7 +185,7 @@
}

.tooltip-inner {
background: rgba(36,193,246,0.9);
background: #4d4d4d;
padding: 40px;
-webkit-transform: translate3d(0,100%,0);
transform: translate3d(0,100%,0);
Expand Down
2 changes: 1 addition & 1 deletion source/main.0cf68a.css

Large diffs are not rendered by default.