Mkdocs: On blog-style site, how do I make Next button go to chronologically next topic?

421 Views Asked by At

I've set up an mkdocs site using the Material theme where my topics are in reverse chronological order - that is, the most recent is at the top of the nav set.

Unfortunately this means my Next and Prev buttons take you to the prev-in-time and next-in-time topics.

What's the quickest way to resolve is?

I tried making some changes to footer.html but while I could get the buttons to change I couldn't get the formatting right.

1

There are 1 best solutions below

0
On

Even if you figure out how to change, then whenever you run mkdocs build, the changes will be lost.
The best way I can think of is reverse your current order in your mkdocs.yml's nav section.

In case, if you still want to modify html file, then let say's my previous button goes to about.html page and I want it to go to more.html page, then I should do the following in my html file

Replace <a href="about.html" with <a href="more.html"

You need to do something similar.
Thanks :)