Merge pull request #36 from zhengxiaopeng/master

Support article catalogue
This commit is contained in:
ppoffice 2015-08-08 12:02:55 +08:00
commit c6740512cf
4 changed files with 56 additions and 1 deletions

View File

@ -18,6 +18,7 @@ widget:
article:
comments: 'Comments'
share: 'Share'
catalogue: 'Catalogue'
profile:
follow: 'FOLLOW'
post: 'post'

View File

@ -18,6 +18,7 @@ widget:
article:
comments: '评论'
share: '分享到'
catalogue: '文章目录'
profile:
follow: '关注我'
post: '文章'

View File

@ -22,6 +22,12 @@
</p>
<% } %>
<% } else { %>
<% if (!index && post.toc){ %>
<div id="toc" class="toc-article">
<strong class="toc-title"><%= __('article.catalogue') %></strong>
<%- toc(post.content) %>
</div>
<% } %>
<%- post.content %>
<% } %>
</div>

View File

@ -325,4 +325,51 @@ $article-share-link
img
display: block
max-width: 100%
margin: 0 auto
margin: 0 auto
/* toc */
.toc-article
background #F9F9F9
margin 2em 0 0 0.2em
padding 1em
border-radius 0px
.toc-title
font-size 120%
strong
padding 0.3em 1
ol.toc
width 100%
margin 1em 2em 0 0
#toc
line-height 1em
font-size 0.8em
float right
.toc
padding 0
li
list-style-type none
.toc-child
padding-left 0em
#toc.toc-aside
display none
width 13%
position fixed
right 2%
top 320px
overflow hidden
line-height 1.5em
font-size 1em
color color-heading
opacity .6
transition opacity 1s ease-out
strong
padding 0.3em 0
color color-font
&:hover
transition opacity .3s ease-out
opacity 1
a
transition color 1s ease-out
&:hover
color color-theme
transition color .3s ease-out