Permalink
Browse files

add: option for TOC title wrap 目录标题换行

Add an option to keep TOC title on the same line.
启用该选项后目录标题不再换行。

#15
  • Loading branch information...
MOxFIVE committed Dec 19, 2015
1 parent cbe3921 commit 4490fdb00ce1885cbbe22d06c37cd9e598af50c9
Showing with 24 additions and 2 deletions.
  1. +5 −1 _config.yml
  2. +19 −1 layout/_partial/toc.ejs
View
@@ -87,4 +87,8 @@ aboutme: 专注于前端
#Site Verification for Google and Baidu. HTML label content.
#百度、谷歌站长验证。填写 HTML 标签 content
#baidu_site:
#google_site:
#google_site:
#Keep TOC title on the same line.
#目录中标题不换行
#toc_nowrap: true
View
@@ -38,4 +38,22 @@
$(".switch-btn").css("display","block");
$(".switch-area").css("display","block");
}
</script>
</script>
<% if (theme.toc_nowrap) { %>
<style>
.toc {
white-space: nowrap;
overflow-x: hidden;
}
</style>
<script>
$(document).ready(function() {
$(".toc li a").mouseover(function() {
var title = $(this).attr('href');
$(this).attr("title", title);
});
})
</script>
<% } %>

0 comments on commit 4490fdb

Please sign in to comment.