You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: src/quantecon_book_theme/theme/quantecon_book_theme/layout.html
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -131,8 +131,8 @@
131
131
132
132
<divclass="qe-page__toc">
133
133
134
-
{% if theme_sticky_contents is defined and theme_sticky_contents is sameas true %}
135
-
<divclass="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
+
<divclass="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 %}">
136
136
{%- else %}
137
137
<divclass="inner">
138
138
{%- endif %}
@@ -177,7 +177,7 @@
177
177
{{ prev_title or prev.title }}</a></p>
178
178
{%- endif %}
179
179
{% 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") %}
181
181
{# Back to top is handled by JavaScript in sticky mode #}
182
182
<ahref="#top" class="back-to-top-btn" title="Back to top">↑ Top</a>
0 commit comments