Reorder wiki pages

Hello,

I would like to use the GH wiki to create a structured documentation with a table of contents where all the entries are displayed as hyperlinks that branch to the corresponding pages. Is that possible?

By default, the wiki pages are ordered according to the alphabetical order. How can I reorder them?

Thank you!

1 Like

Hi @lassaubatju-c, Thank you for being here! I don’t think this will be possible with the GitHub wiki system. You can however add a custom sidebar and include hyperlinks there.

Another option you might consider could be using GitHub Pages

1 Like

The only way you might currently achieve this right now is by writing a script that automatically generates the _Sidebar.<extension> file based on some custom criteria and the page files present in the Wiki repository.

This shouldn’t be hard to achiveve, provided you have at least Collaborator access to the repository, so that you can clone it locally and push to it. I actually use similar script to maintain some auto-generated pages in various Wikis (not for TOCs or sidebars, but the principle is similar).

The downside is that only maintainers will be able to update the TOC, and will have to do it periodically, locally, and push the updated sidebar each time.

From what I gather, it’s not currently possible to leverage CI services or GitHub Actions for Wikis, so it will have to rely on scripted automation.

Here’s an example of an auto-generated Wiki page and the script used:

I hope it might be of help or inspiration.

2 Likes

Thank you for the explanations!

1 Like