Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add page title override: {{#title My Title}} #1381

Merged
merged 2 commits into from
Mar 24, 2021

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Nov 12, 2020

This PR makes it possible for a chapter to have a page <title> that is different from its entry in the TOC.

I have my own usage for this, but here is an example from https://doc.rust-lang.org/1.47.0/book/appendix-01-keywords.html:



It's reasonable for the appendices to be lettered A, B, C in the sidebar, but "A - Keywords" does not serve as a good webpage title. They'd likely want either "Keywords" as the title, or "Appendix A: Keywords" matching the h1 of the page. At the same time they likely wouldn't want "Appendix A: Keywords" in the sidebar due to very limited horizontal space.

SUMMARY.md:

# The Rust Programming Language
...
- [Appendix](appendix-00.md)
  - [A - Keywords](appendix-01-keywords.md)

appendix-01-keywords.md:

{{#title Keywords}}
# Appendix A: Keywords

@Dylan-DPC-zz
Copy link

thanks

@Dylan-DPC-zz Dylan-DPC-zz merged commit 94f7578 into rust-lang:master Mar 24, 2021
@dtolnay dtolnay deleted the title branch March 24, 2021 01:52
titaneric pushed a commit to titaneric/mdBook that referenced this pull request Apr 6, 2021
* Add page title override: {{#title My Title}}

* Document {{#title}} in guide
notriddle pushed a commit to notriddle/mdBook that referenced this pull request Dec 23, 2021
* Add page title override: {{#title My Title}}

* Document {{#title}} in guide
rubenmoor pushed a commit to rubenmoor/mdBook that referenced this pull request Aug 5, 2022
* Add page title override: {{#title My Title}}

* Document {{#title}} in guide
rubenmoor pushed a commit to rubenmoor/mdBook that referenced this pull request Aug 5, 2022
* Add page title override: {{#title My Title}}

* Document {{#title}} in guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants