Skip to content

Commit

Permalink
add: options for Copyright info. & TOC 目录和文末信息设置
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
MOxFIVE committed Jan 27, 2016
1 parent 946ff7c commit 60a984c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,25 @@ Remove toc and the button via putting `toc: false` before "---" at [post].md.

文章中默认显示目录和对应切换按钮,在文章 “---” 前输入 `toc: false` 关闭目录。

Hide toc in default | 默认不显示目录

> Set `toc: false` in `yelee/_config.yml`.
(*Set `toc: true` in front-matter to show it in certain post*)


#### 7. Copyright info. 文章版权信息:

Hide this via putting `original: false` to post's front-matter.
Hide this via putting `original: false` to post's front-matter.

在文章顶部插入行 `original: false` 关闭文章版权声明框

Hide Copyright info. in default | 默认不显示版权信息

> Set `copyright: false` in `yelee/_config.yml`.
(*Set `original: true` in front-matter to show it in certain post*)

#### 8. 404 Page:

```
Expand Down
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ blockquote_style:
# 左边栏宽度 px
left_col_width: 300

# Copyright info. of post | 文末版权信息
copyright: true

# Table of contents | 文章目录
toc: true

# 目录中标题不换行
# Keep TOC title on the same line |
toc_nowrap: false
Expand Down
4 changes: 2 additions & 2 deletions layout/_partial/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
<%- partial('post/nav') %>
<% } %>
</article>
<% if (!index && post.toc != false && !is_page()){ %>
<% if (!index && ((post.toc != false && !is_page() && theme.toc) || post.toc)){ %>
<%- partial('_partial/toc') %>
<% } %>
<% if (!index && theme.share){ %>
<%- partial('post/share') %>
<%- partial('post/share') %>
<% } %>

<% if (!index && post.comments){ %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/post/nav.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if (post.original != false && !is_page()){ %>
<% if ((post.original != false && !is_page() && theme.copyright) || post.original){ %>
<div class="copyright">
<p><span>本文标题:</span><a href="<%- url_for(post.path) %>"><%= post.title %></a></p>
<p><span>文章作者:</span><a href="/" title="访问 <%=theme.author%> 的个人博客"><%=theme.author%></a></p>
Expand Down

0 comments on commit 60a984c

Please sign in to comment.