Skip to content

Commit

Permalink
新增了是否显示用于切换TOC目录展开收缩的按钮配置
Browse files Browse the repository at this point in the history
  • Loading branch information
blinkfox committed Mar 10, 2019
1 parent 53ea049 commit a92088a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ socialLink:
toc:
enable: true
heading: h2, h3, h4
showToggleBtn: true # 是否显示切换TOC目录展开收缩的按钮

# Whether the code is broken.
# 代码是否折行
Expand Down
4 changes: 4 additions & 0 deletions layout/_partial/post-detail-toc.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@
</div>

<!-- TOC 悬浮按钮. -->
<% if (theme.toc.enable && theme.toc.showToggleBtn) { %>
<div id="floating-toc-btn" class="hide-on-med-and-down">
<a class="btn-floating btn-large bg-color">
<i class="fa fa-list"></i>
</a>
</div>
<% } %>

<script src="<%- theme.libs.js.tocbot %>"></script>
<script>
Expand Down Expand Up @@ -141,6 +143,7 @@
}
});
<% if (theme.toc.enable && theme.toc.showToggleBtn) { %>
/* 修复文章卡片 div 的宽度. */
let fixPostCardWidth = function (srcId, targetId) {
let srcDiv = $('#' + srcId);
Expand Down Expand Up @@ -175,5 +178,6 @@
}
fixPostCardWidth('artDetail', 'prenext-posts');
});
<% } %>
});
</script>

0 comments on commit a92088a

Please sign in to comment.