jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

TOC title ignored for first page

Open SamLau95 opened this issue 5 years ago • 2 comments

Describe the bug

The documentation states that the title key overrides the automatic title (https://jupyterbook.org/customize/toc.html#specifying-alternate-titles). However, the title key does not work for the first page in the TOC. For example, in the screenshot below I want the first page in the TOC to have the title "Introduction" but keep the main title of the page as-is.

Screen Shot 2020-10-03 at 4 54 32 PM

To Reproduce

Steps to reproduce the behavior:

Add this intro.md file:

# Principles and Techniques of Data Science

test

In _toc.yml:

- file: intro
  title: Introduction

Expected behavior

First entry of the generated TOC in the sidebar should be "Introduction", not "Principles and Techniques of Data Science".

Environment

  • Python Version [e.g. 3.7.1]: 3.8.3
  • Package versions or output of jupyter-book --version: 0.8.2
  • Operating System: macOS

SamLau95 avatar Oct 03 '20 23:10 SamLau95

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
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).
Welcome to the EBP community! :tada:

welcome[bot] avatar Oct 03 '20 23:10 welcome[bot]

ah, that's a good catch! this is because we're special-casing the first page here: https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/init.py#L123

that's where we'd need to add a check for whether title has been given for that page in _toc.yml and update the output accordingly

choldgraf avatar Oct 05 '20 22:10 choldgraf