The HTML output apparently contains two versions of the in-page table of contents, one for printing and one for screens. The toc_title string is only updated in the one for printing, not the one for screens (see below excerpts below, one containing the string MY_TOC_TITLE the other On this page).
toc for print
<div id="jb-print-docs-body" class="onlyprint">
<h1>Installation og opsætning</h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
<div>
<h2> MY_TOC_TITLE </h2>
</div>
<nav aria-label="Page">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#installation-of-git">
2.1. Installation of git
</a>
<ul class="visible nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href=#windows">
2.1.1. Windows
toc for screens
<div class="bd-sidebar-secondary bd-toc">
<div class="toc-item">
<div class="tocsection onthispage">
<i class="fa-solid fa-list"></i> On this page
</div>
<nav id="bd-toc-nav" class="page-toc">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#installation-of-git">
2.1. Installation of git
</a>
<ul class="visible nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href="#windows">
2.1.1. Windows
With version 0.4.0rc1 the default string CONTENTS is no longer shown on screens, it shows ON THIS PAGE instead. Presumably due to the same issue (only the toc for printing has its title string updated).
Reproduce the bug
Use theme version 0.4.0rc1 when building HTML-output with this in cont.py:
Describe the bug
Renaming the in-page Table of Contents as described here https://sphinx-book-theme.readthedocs.io/en/stable/customize/sidebar-secondary.html#rename-the-in-page-table-of-contents no longer works in 0.4.0rc1.
The HTML output apparently contains two versions of the in-page table of contents, one for printing and one for screens. The
toc_title
string is only updated in the one for printing, not the one for screens (see below excerpts below, one containing the stringMY_TOC_TITLE
the otherOn this page
).toc for print
toc for screens
With version 0.4.0rc1 the default string
CONTENTS
is no longer shown on screens, it showsON THIS PAGE
instead. Presumably due to the same issue (only the toc for printing has its title string updated).Reproduce the bug
Use theme version 0.4.0rc1 when building HTML-output with this in
cont.py
:Look at the right-side in-page Table of Contents header. It shows
ON THIS PAGE
instead ofCONTENTS
as in version 0.3.3.Inspect the HTML markup and the strings
MY_TOC_TITLE
as well asOn this page
will be found in the toc for printing and screens respectively.List your environment
Build with sphinx 5.3.0 and theme version 0.4.0rc1 on Linux.
Reference behavior was build with sphinx 4.5.0 and theme version 0.3.3