old|todim }})').matches) {
                sidebar = 'visible';
                // NB: We don't store the value in localStorage!
            }
{%- endif %}
{%- if pagename == "search" and theme_sidebar_overlay_width != None %}
            // hide sidebar on narrow screen
            if (sidebar === 'visible' && window.matchMedia('(max-width: {{ theme_sidebar_overlay_width|todim }})').matches) {
                localStorage.removeItem('sphinx-sidebar');
                sidebar = 'hidden';
            }
{%- e