GitHub wiki directories
Asked Answered
T

7

100

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.

Tonsillitis answered 18/6, 2012 at 17:50 Comment(0)
C
67

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

Clementclementas answered 8/10, 2012 at 17:18 Comment(6)
The current short answer is "Yes". :)Ticker
@Ticker After THREE years? GitHub really takes their user's request seriously! :|Dogma
Yep, still no, five years laterRime
Six years. Btw, heard people moaning about #Microsoft got the #GitHub back in the office. Today I've got too many disappointing and I think I can laugh them in face now.Dendroid
We can do it this way docs.gitlab.com/ee/user/project/wikiYesseniayester
@AmritaDeb Your link relates to GitLab, but this question was specifically about GitHub.Clementclementas
T
32

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

Ticker answered 28/3, 2013 at 10:33 Comment(1)
So basically, it just for organising your pages, but doesn't give you anything more.Bootleg
F
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.

Firsthand answered 7/8, 2013 at 1:19 Comment(2)
the lack of sub-pages makes Gollum and GitHub wiki by extension a crippled "wiki".Cutcliffe
Funnily enough, Gollum's github says (at least nowadays) "Pages may be organized into directories any way you choose."Traction
L
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.

Lucite answered 14/1, 2015 at 18:26 Comment(2)
That is the approach I have taken, but it leaves a "Pages" part that is a huge mess of pages (over 60 in my project).Vestryman
The Pages part is collapsed so it doesn't clutter the sidebar thankfullyPhosphoprotein
F
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.

Flooring answered 11/6, 2014 at 13:24 Comment(5)
I don't think this is correct. I was looking at one of the git recommended wiki sites, 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.Shirting
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.Shirting
This incredibly ugly and redundant format seems to works [PageName](PageName)Shirting
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.Kislev
That github showcase in Ed Ost's comment no longer exists. An alternative fwiw quora.com/…Jeanejeanelle
L
1

Still no intention of adding this 9/2022.

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

Lutero answered 6/9, 2022 at 20:36 Comment(1)
March 2023: Official GitHub Support answer: "no support, not on their roadmap".Brachy
M
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.

Marxmarxian answered 20/7, 2022 at 23:6 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.