Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Rules
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2017-08-04 16:17:13 +0300
committerAchilleas Pipinellis <axilleas@axilleas.me>2017-08-04 16:17:13 +0300
commit9e5e8b08d5817238b910bf96af72557691a297e0 (patch)
tree00002fa50ccf8e1fe0b734fe238a9c5f08819121 /Rules
parent524709e9faa0664c9696a7125edd61f73cc3d7ea (diff)
Enable/disable ToC at will
Diffstat (limited to 'Rules')
-rw-r--r--Rules6
1 files changed, 5 insertions, 1 deletions
diff --git a/Rules b/Rules
index 989e14c4..bfa64499 100644
--- a/Rules
+++ b/Rules
@@ -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,