Skip to content

Commit 6e162a8

Browse files
committed
FIX: Handle string boolean values from theme.conf in Jinja templates
- Theme config values come as strings ('True'/'False') not booleans - Updated conditionals to check for both boolean and string values - Fixes autoexpand not being enabled despite default True in theme.conf
1 parent a162725 commit 6e162a8

File tree

1 file changed

+3
-3
lines changed
  • src/quantecon_book_theme/theme/quantecon_book_theme

1 file changed

+3
-3
lines changed

src/quantecon_book_theme/theme/quantecon_book_theme/layout.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131

132132
<div class="qe-page__toc">
133133

134-
{% if theme_sticky_contents is defined and theme_sticky_contents is sameas true %}
135-
<div class="inner sticky" data-autoexpand="{% if theme_contents_autoexpand is defined and theme_contents_autoexpand is sameas true %}true{% else %}false{% endif %}">
134+
{% if theme_sticky_contents is defined and (theme_sticky_contents is sameas true or theme_sticky_contents == "True" or theme_sticky_contents == "true") %}
135+
<div class="inner sticky" data-autoexpand="{% if theme_contents_autoexpand is defined and (theme_contents_autoexpand is sameas true or theme_contents_autoexpand == 'True' or theme_contents_autoexpand == 'true') %}true{% else %}false{% endif %}">
136136
{%- else %}
137137
<div class="inner">
138138
{%- endif %}
@@ -177,7 +177,7 @@
177177
{{ prev_title or prev.title }}</a></p>
178178
{%- endif %}
179179
{% endmacro %}
180-
{% if theme_sticky_contents is defined and theme_sticky_contents is sameas true %}
180+
{% if theme_sticky_contents is defined and (theme_sticky_contents is sameas true or theme_sticky_contents == "True" or theme_sticky_contents == "true") %}
181181
{# Back to top is handled by JavaScript in sticky mode #}
182182
<a href="#top" class="back-to-top-btn" title="Back to top">↑ Top</a>
183183
{% else %}

0 commit comments

Comments
 (0)