diff --git a/config.toml b/config.toml index 2c9cf1e..59069f2 100644 --- a/config.toml +++ b/config.toml @@ -18,4 +18,7 @@ easydocs_logo_always_clickable = false # Notes: # - Also requries the base URL to be set to the local folder where the site is stored eg. base_url = /home/user/mysite/public/ # - This is not portable and only works with a specific local folder -easydocs_uglyurls = false \ No newline at end of file +easydocs_uglyurls = false + +# Controls how many headings are needed on a page before the headings show in the navigation on the left +easydocs_heading_threshold = 4 \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index e437362..0c96594 100644 --- a/templates/index.html +++ b/templates/index.html @@ -81,6 +81,7 @@ {% if current_path == page.path -%} + {# Count number of headers on page #} {% set_global header_count = 0 -%} {% for h2 in page.toc -%} {% set_global header_count = header_count + 1 -%} @@ -92,7 +93,8 @@ {% endfor -%} {% endfor -%} - {% if header_count > 4 -%} + {# Output headers if above threshold #} + {% if header_count > config.extra.easydocs_heading_threshold -%}