diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2017-08-28 16:52:52 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2017-08-28 16:52:52 +0300 |
commit | 569175d4e35307b31e013d69d5aef4e336392dad (patch) | |
tree | 6826e172d6ecd729138a3d369dba0b64beb7e6ea /Rules | |
parent | dd5117a0b5d1d7cbeb13f4004746f23492608552 (diff) | |
parent | 9e5e8b08d5817238b910bf96af72557691a297e0 (diff) |
Merge branch 'enable-disable-toc' into 'master'
Enable/disable ToC at will
See merge request !107
Diffstat (limited to 'Rules')
-rw-r--r-- | Rules | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -30,7 +30,11 @@ end compile '/**/*.md' do if item[:redirect].nil? - include_toc = item.identifier.to_s.split("/")[2].end_with?("README.md", "index.md") ? false : true + + # If 'toc' is absent in a file's yaml frontmatter, show ToC. + # Set to 'toc: false' to disable it. + include_toc = item[:toc].nil? ? true : false + # Use Redcarpet with Rouge. filter :redcarpet, renderer: HTML, |