GitHub wiki directories

GithubWiki

Github Problem Overview


Does the wiki that installs with a GitHub repo support directories? Our wiki is cluttered with pages, and we are looking for a way to organize them better.

We tried pulling the repo, creating local directories, and moving things around, but when committed back, the wiki didn't pick up the changes.

Github Solutions


Solution 1 - Github

I was having the exact same issue and tried variants of what you tried. Nothing stuck. Asked GitHub support about it and received a reply that essentially said "No, but we'll let the developers know that people are interested in this feature."

So the short answer is "No", and the long answer is "No, but maybe in the future."

Solution 2 - Github

Actually, it looks like github added support for directories recently.

I was able to do the following:

  • Move an existing markdown file to a new directory.
  • Create a new markdown file in an existing directory (created in the former step).
  • Create a new markdown file in a new directory.

In all cases, the existing pages were still there and new pages were added.

The one constraint that remains is that your file names must be unique. If you have more than one file with the same name, only one of them will show up in the wiki (I'm not sure which.. ).

Solution 3 - Github

The GitHub wiki (aka Gollum) does use directories but not in the way you may expect.

The documentation on the Gollum wiki could use some work but this is what I have figured out mostly via testing.

  • All files appear in the root of the wiki no matter where they are placed in the repo.
  • _Header, _Footer and _Sidebar files are per-directory, but inherited if there is none present in a child folder.
  • File links can be relative to the source file (keep your files with your content).

So, if you want directories for namespacing you are out of luck. Consider using the {namespace}-{page} scheme for namespacing.

Solution 4 - Github

It's not the an ideal solution but the workaround would be to create a custom sidebar where you create a table of contents with links to your pages. I find this to be better than folders anyway because it allows you to have a link to a single page under multiple hierarchies.

Solution 5 - Github

Actually, there is still a limitation. Yes, you can add 1 level (so, 1 subfolder). But that's it! I refactored my whole documentation layout, creating multiple levels of subfolders for organisation, but that was a no-go.

sigh

I must say: I'm appalled by this Gollum thing. I'm surprised Github even picked it up.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohn LivermoreView Question on Stackoverflow
Solution 1 - GithubCollin MView Answer on Stackoverflow
Solution 2 - GithubMarcoView Answer on Stackoverflow
Solution 3 - GithubKevin CoxView Answer on Stackoverflow
Solution 4 - GithubThanh NguyenView Answer on Stackoverflow
Solution 5 - GithubgjorisView Answer on Stackoverflow