96

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.

John Livermore
  • 30,235
  • 44
  • 126
  • 216

7 Answers7

65

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."

Collin M
  • 1,143
  • 1
  • 12
  • 16
31

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.. ).

Marco
  • 8,958
  • 1
  • 36
  • 56
30

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.

Kevin Cox
  • 3,080
  • 1
  • 32
  • 32
  • 14
    the lack of sub-pages makes Gollum and GitHub wiki by extension a crippled "wiki". –  Nov 25 '15 at 16:20
  • Funnily enough, Gollum's github says (at least nowadays) "Pages may be organized into directories any way you choose." – Tonsic Nov 25 '21 at 17:44
16

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.

Thanh Nguyen
  • 495
  • 6
  • 11
1

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.

gjoris
  • 1,731
  • 2
  • 17
  • 22
  • 2
    I don't think this is correct. I was looking at one of the git recommended wiki sites, https://github.com/showcases/projects-with-great-wikis . I did a git clone and sure enough they have at least three levels of subdirectories. Take a look at the technical-documentation/1-trackers/ruby-tracker for example. – Ed Ost Aug 25 '14 at 03:40
  • ok, i tested it myself and it does seem that gollum has a problem with subdirectories that have the same name as even the link text. This is kind of wierd. I would understand if there was a collision in the actual page name, but when using mediaWiki syntax [[Link Text|WikiPage]] it does indeed seem to get confused between Link Text and actual directory name. – Ed Ost Aug 25 '14 at 04:46
  • This incredibly ugly and redundant format seems to works [PageName](PageName) – Ed Ost Aug 25 '14 at 05:03
  • 1
    gollum-lib does allow pagenames to have slashes, which behaves like you'd expect. Unfortunately, neither GitHub nor the "official" Sinatra-based Gollum frontend support these sensibly. – gerwitz Oct 14 '14 at 18:10
  • 1
    That github showcase in Ed Ost's comment no longer exists. An alternative fwiw https://www.quora.com/What-are-some-examples-of-very-well-made-GitHub-wiki-pages-for-open-source-projects – simesy Jul 26 '19 at 04:11
1

Still no intention of adding this 9/2022.

https://github.com/orgs/community/discussions/23914

abalter
  • 9,663
  • 17
  • 90
  • 145
  • March 2023: [Official GitHub Support answer](https://github.com/orgs/community/discussions/23914#discussioncomment-5447162): "no support, not on their roadmap". – VonC Mar 28 '23 at 08:15
0

Well, that's a disappointing missing feature! What I try to do is to actually have directories under a docs directory and in each one, a README.md file. Not great...but works for documentation and organizes stuff. If you want to go further, you can have a different branch only with these files.

Felipe N Moura
  • 1,367
  • 11
  • 13