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

Add copyright info support #383

Merged
merged 4 commits into from
May 8, 2018
Merged
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
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts
- recent_comments
- links

post_copyright:
enable: false
author: your name
# copyright_text: your copyright text

links:
- title: site-name1
url: http://www.example1.com/
Expand Down
4 changes: 4 additions & 0 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ shareto: Share
Discuss: Discuss
Comment: Comment
Hits: Hits
copyright_author_prefix: "Author: "
copyright_link_prefix: "Blog Link: "
copyright_declare_prefix: "Copyright Declaration: "
copyright_default_text: "The author owns the copyright. Please indicate the source reproduced!"
4 changes: 4 additions & 0 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ shareto: 分享
Discuss: 条参与
Comment: 条评论
Hits: 阅读
copyright_author_prefix: 本文作者:
copyright_link_prefix: 本文链接:
copyright_declare_prefix: 版权声明:
copyright_default_text: 本博客所有文章除特别声明外,均采用 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/cn/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0 CN</a> 许可协议。转载请注明出处!
18 changes: 18 additions & 0 deletions layout/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ block content
!= page.content
if theme.donate.enable == true
iframe(src='/donate/?AliPayQR=' + theme.donate.alipay_qr + '&WeChatQR=' + theme.donate.wechat_qr + '&GitHub=' + theme.donate.github + '&BTCQR=' + theme.donate.btc_qr + '&BTCKEY='+ theme.donate.btc_key + '&PayPal=' + theme.donate.paypal_url, style='overflow-x:hidden; overflow-y:hidden; border:0xp none #fff; min-height:240px; width:100%;', frameborder='0', scrolling='no')

if theme.post_copyright.enable == true
div
ul.post-copyright
li.post-copyright-author
strong= __('copyright_author_prefix')
= theme.post_copyright.author
li.post-copyright-link
strong= __('copyright_link_prefix')
a(href='/' + page.path)= page.permalink
li.post-copyright-license
strong= __('copyright_declare_prefix')
if theme.post_copyright.copyright_text
!= theme.post_copyright.copyright_text
else
!= __('copyright_default_text')
br

if theme.shareto == true
script(type='text/javascript', src=url_for(theme.js) + '/share.js' + '?v=' + theme.version, async)
a.article-share-link(data-url=page.permalink, data-id=page._id, data-qrcode=qrcode(page.permalink))= __('shareto')
Expand Down
13 changes: 13 additions & 0 deletions source/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1713,3 +1713,16 @@ em.search-keyword {
background-color: #999999;
text-shadow: 0
}


// Custom styles.
.post-copyright {
margin: 2em 0 0;
padding: 0.5em 1em;
border-left: 3px solid #FF1700;
background-color: #F9F9F9;
list-style: none;
li {
margin: 8px 0;
}
}