It is possible config previous/next section/page for current dicrectory #4433
-
Hi everyone, I want to customize previous/next button in footer. Currently, the function
Scenario 01:
My expectation :
Scenario 02:
My expectation :
Thank you for help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Thanks for asking. It's currently not possible, but it might be a great idea for a plugin! |
Beta Was this translation helpful? Give feedback.
-
Hi there, New to MkDocs and Material and was thinking along similar lines for my new layout/navigation, the top-level sections are not related, and I wanted to just drop the Next/Previous link on the first and last page in each top-level section. It is possible, although manually on the first and last pages of each section, (although others may know a better way): Add the markdown_extensions:
- attr_list On the first page on a main section hide the Previous Link, I just put the CSS inline in the main body of the page markdown: ---
title: First Page in Section
----
<style>
.md-footer__link--prev:not([hidden]) { display: none }
</style> And then on the last page of the section: ---
title: Last Page in Section
----
<style>
.md-footer__link--next:not([hidden]) { display: none }
</style> I am not sure if this will "break" anything in the future, but it seems to work in my setup! I just need to remember when I add a new page that then becomes the new last page to update the previous page, no big deal unless the site is massive, I guess. |
Beta Was this translation helpful? Give feedback.
Thanks for asking. It's currently not possible, but it might be a great idea for a plugin!