From d4b6610c1812e634d3024923ed9143daddb7e761 Mon Sep 17 00:00:00 2001 From: Che <43485962+c-git@users.noreply.github.com> Date: Fri, 19 Aug 2022 21:28:19 -0400 Subject: [PATCH] Take into account value not in config Had to change to greater than or equal to because I couldn't find a way to differentiate between 0 and undefined. --- config.toml | 4 ++-- templates/index.html | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config.toml b/config.toml index 59069f2..7b843dd 100644 --- a/config.toml +++ b/config.toml @@ -20,5 +20,5 @@ easydocs_logo_always_clickable = false # - This is not portable and only works with a specific local folder 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 +# Minimum number of headings needed on a page before the headings show in the navigation on the left. Defaults to 5. +easydocs_heading_threshold = 5 \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 0c96594..15c2af1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -94,7 +94,15 @@ {% endfor -%} {# Output headers if above threshold #} - {% if header_count > config.extra.easydocs_heading_threshold -%} + {% if not config.extra.easydocs_heading_threshold -%} + {# Undefined or 0 unable to find a way to differnciate between 0 and undefined. + 1 is already including any headings so is not 0 not needed #} + {% set _threshold = 5 -%} + {% else %} + {% set _threshold = config.extra.easydocs_heading_threshold -%} + {% endif -%} + + {% if header_count >= _threshold -%}