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 <axil@gitlab.com>2017-08-28 16:52:52 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2017-08-28 16:52:52 +0300
commit569175d4e35307b31e013d69d5aef4e336392dad (patch)
tree6826e172d6ecd729138a3d369dba0b64beb7e6ea /Rules
parentdd5117a0b5d1d7cbeb13f4004746f23492608552 (diff)
parent9e5e8b08d5817238b910bf96af72557691a297e0 (diff)
Merge branch 'enable-disable-toc' into 'master'
Enable/disable ToC at will See merge request !107
Diffstat (limited to 'Rules')
-rw-r--r--Rules6
1 files changed, 5 insertions, 1 deletions
diff --git a/Rules b/Rules
index cb0fd3b2..29bd0732 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,