mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Is it possible to show name of the next/previous page ?

Open Celthi opened this issue 3 years ago • 1 comments

All the book I read written by mdBook does not show the name/title of the next/previous page in the links to them. For example Screen Shot 2022-07-16 at 6 48 21 AM

Usually, it is hard to know where I will go if I click the next page. I see the next/previous button/link of the Gitbook will show the title of the next/previous page along with the next/previous page link.

Instead, docs created by gitbook like have the names Screen Shot 2022-07-16 at 7 04 58 AM

Celthi avatar Jul 15 '22 23:07 Celthi

If you edit the theme, you can do it using the {{title}} handlebars variable.

{{#previous}}
    <a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
        {{title}}
    </a>
{{/previous}}

{{#next}}
    <a rel="next" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
        {{title}}
    </a>
{{/next}}

wilwade avatar Feb 20 '24 20:02 wilwade