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
Whereas most changes to _toc.yml (new pages, etc.) will be taken into account on a new build, changing the root entry will only take effect if the _build directory is cleared first. If not, index.html will continue to direct to the old root entry. This seems wrong or at least inconsistent.
The culprit seems to be the automatically-generated redirect file index.html that is created if the requested root file is not already named 'index'. This file persists across builds even if _toc.yml requests a different root.
Link to your repository or website
No response
Steps to reproduce
The script below runs a hopefully reproducible example showing:
Other changes such as adding new files work fine.
Changing the root entry does not.
Changing the root entry does work if the build cache is first cleared.
#!/bin/bash -v
#
# Create the prefab exaple book.
# Remove the example notebook (just to avoid unnecessary dependencies).
# Simplify _toc.yml.
#
rm -r mynewbook/
jupyter-book create mynewbook/
rm mynewbook/notebooks.ipynb
echo '
format: jb-book
root: intro
chapters:
- file: markdown
' > mynewbook/_toc.yml
#
# Build.
# Confirm structure of built book.
#
jupyter-book build mynewbook/
firefox mynewbook/_build/html/index.html
#
# Add a new file.
#
echo '
# foo
' > mynewbook/foo.md
echo '
format: jb-book
root: intro
chapters:
- file: markdown
- file: foo
' > mynewbook/_toc.yml
#
# Confirm new file is added.
#
jupyter-book build mynewbook/
firefox mynewbook/_build/html/index.html
#
# Change root file.
#
echo '
format: jb-book
root: foo
chapters:
- file: markdown
' > mynewbook/_toc.yml
#
# Confirm that changed root file does NOT register.
# Old index is used.
#
jupyter-book build mynewbook/
firefox mynewbook/_build/html/index.html
#
# Finally, confirm that changed root file registers if _build cache is cleared.
#
jupyter-book clean mynewbook/
jupyter-book build mynewbook/
firefox mynewbook/_build/html/index.html
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Describe the problem
Whereas most changes to
_toc.yml
(new pages, etc.) will be taken into account on a new build, changing theroot
entry will only take effect if the_build
directory is cleared first. If not,index.html
will continue to direct to the old root entry. This seems wrong or at least inconsistent.The culprit seems to be the automatically-generated redirect file
index.html
that is created if the requested root file is not already named 'index'. This file persists across builds even if_toc.yml
requests a different root.Link to your repository or website
No response
Steps to reproduce
The script below runs a hopefully reproducible example showing:
The version of Python you're using
3.8.10
Your operating system
Ubuntu 20.04.2
Versions of your packages
Additional context
No response
The text was updated successfully, but these errors were encountered: