GitHub wiki directories

对着背影说爱祢 提交于 2019-12-03 04:08:12

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

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

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 NS-Page scheme for namespacing.

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.

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!