From 14f1f432c9e33ab6782932991cfd8b239e9e512c Mon Sep 17 00:00:00 2001
From: shenyu <448766534@qq.com>
Date: Fri, 7 Feb 2020 12:42:33 +0800
Subject: [PATCH] feat: Copyright
---
README.md | 4 ++++
_config.yml | 6 +++++-
layout/_partial/article.ejs | 16 +++++++++++++++-
layout/_partial/post/share.ejs | 1 +
source/css/_partial/article.styl | 14 +++++++++++---
source/css/_partial/reward.styl | 2 +-
source/css/_partial/share.styl | 23 +++++++++++++++++++----
7 files changed, 56 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 2bfd2ba..a613b96 100644
--- a/README.md
+++ b/README.md
@@ -141,6 +141,10 @@ alipay: /images/alipay.jpg
# qrcode image path
weixin: /images/wechat.jpg
+# Copyright
+# type:0-close all; 1-only display in article which you have configured copyright: true; 2-all articles
+copyright_type: 2
+
# Search
search: true
diff --git a/_config.yml b/_config.yml
index 649639c..6dca455 100644
--- a/_config.yml
+++ b/_config.yml
@@ -77,6 +77,10 @@ alipay: /images/alipay.jpg
# 微信二维码图片地址
weixin: /images/wechat.jpg
+# 版权声明
+# 版权声明type设定:0-关闭版权声明; 1-文章对应的md文件里有copyright: true属性,才有版权声明; 2-所有文章均有版权声明
+copyright_type: 2
+
# 是否启用搜索
search: true
@@ -110,7 +114,7 @@ gitalk:
# GitHub Ribbons(https://github.blog/2008-12-19-github-ribbons/)
github:
# (关闭请设置为false)
- url: https://github.com/Shen-Yu/hexo-theme-ayer
+ url: false
# fancybox(仅用于相册展示,若需要可配置albums)
fancybox: true
diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs
index 411bc5a..770a4db 100644
--- a/layout/_partial/article.ejs
+++ b/layout/_partial/article.ejs
@@ -33,18 +33,32 @@
<% } else { %>
<%- post.content %>
<% } %>
-
+
<% if ((theme.reward_type === 2 || (theme.reward_type === 1 && post.reward)) && !index && !post.no_reward){ %>
打赏
<% } %>
+
+ <% if (((theme.copyright_type === 2) || (theme.copyright_type === 1 && post.copyright)) && !index){ %>
+
+ <% } %>
diff --git a/layout/_partial/post/share.ejs b/layout/_partial/post/share.ejs
index 415996f..569dcd7 100644
--- a/layout/_partial/post/share.ejs
+++ b/layout/_partial/post/share.ejs
@@ -8,6 +8,7 @@
<%- theme.share_text %>
+
<% if( theme.share_china ){ %>
diff --git a/source/css/_partial/article.styl b/source/css/_partial/article.styl
index 389c5af..e47a51d 100644
--- a/source/css/_partial/article.styl
+++ b/source/css/_partial/article.styl
@@ -104,7 +104,15 @@
.article-footer
clearfix()
- margin-top 3rem
+
+.declare
+ margin 0 0 1rem
+ padding-bottom 1rem
+ border-bottom 1px solid #eee
+ ul
+ list-style none
+ li
+ list-style none
// Tags
.article-tag-list
@@ -151,8 +159,8 @@
.article-nav
clearfix()
position relative
- padding-top 3rem
- margin-top 5rem
+ padding-top 1.5rem
+ margin 1rem 0 2rem
border-top border-width border-color solid
.article-nav-link
diff --git a/source/css/_partial/reward.styl b/source/css/_partial/reward.styl
index 3b71536..3efe296 100644
--- a/source/css/_partial/reward.styl
+++ b/source/css/_partial/reward.styl
@@ -3,7 +3,7 @@
display inline-block
height 36px
line-height 36px
- margin-top 3rem
+ margin 60px 0
padding 0 20px
font-size 18px
color #fff
diff --git a/source/css/_partial/share.styl b/source/css/_partial/share.styl
index 564a9ad..acf9284 100644
--- a/source/css/_partial/share.styl
+++ b/source/css/_partial/share.styl
@@ -1,10 +1,24 @@
.share-wrap {
min-height: 20px;
display: none;
- position: absolute;
+ position: relative;
+ z-index: 1;
right: 0;
- bottom: -32px;
+ bottom: 0;
width: 250px;
+ background-color #f5f5f5;
+ border-radius: 2px;
+ .arrow {
+ position: absolute;
+ z-index: -1;
+ top: -3px;
+ right:20px;
+ display: block;
+ width 10px;
+ height 10px;
+ transform: rotate(45deg);
+ background-color #f5f5f5;
+ }
}
.share-btn {
@@ -12,7 +26,8 @@
position: relative;
}
.share-outer {
- display inline-flex;
+ display: flex;
+ justify-content: flex-end;
border: none;
text-shadow: none;
text-decoration: none;
@@ -28,7 +43,7 @@
transform: none;
cursor: pointer;
}
- }
+}
.share-icons {
display: flex;