diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-08-04 16:17:13 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-08-04 16:17:13 +0300 |
commit | 9e5e8b08d5817238b910bf96af72557691a297e0 (patch) | |
tree | 00002fa50ccf8e1fe0b734fe238a9c5f08819121 /Rules | |
parent | 524709e9faa0664c9696a7125edd61f73cc3d7ea (diff) |
Enable/disable ToC at will
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, |