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.
This commit is contained in:
parent
03db43c11c
commit
d4b6610c18
2 changed files with 11 additions and 3 deletions
|
@ -20,5 +20,5 @@ easydocs_logo_always_clickable = false
|
||||||
# - This is not portable and only works with a specific local folder
|
# - This is not portable and only works with a specific local folder
|
||||||
easydocs_uglyurls = false
|
easydocs_uglyurls = false
|
||||||
|
|
||||||
# Controls how many headings are needed on a page before the headings show in the navigation on the left
|
# Minimum number of headings needed on a page before the headings show in the navigation on the left. Defaults to 5.
|
||||||
easydocs_heading_threshold = 4
|
easydocs_heading_threshold = 5
|
|
@ -94,7 +94,15 @@
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
|
|
||||||
{# Output headers if above threshold #}
|
{# 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 -%}
|
||||||
<ul id="toc">
|
<ul id="toc">
|
||||||
{% for h2 in page.toc -%}
|
{% for h2 in page.toc -%}
|
||||||
<li><a href="
|
<li><a href="
|
||||||
|
|
Loading…
Reference in a new issue