在自己的repository的wiki上添加sidebar,一目了然,适合forker和user查看项目说明。
方法
只需几步即可完成:
1.进入项目的wiki页面
2.复制wiki的repository的URL
3.clone本地repository
git clone git@github.com:chape/mygit.wiki.git
4.新建 _Sidebar.md文件并以wiki语法编辑[[link]],提交更新到remote repository
git commit _Sidebar.md “test1”
git push -u origin master
_Sidebar.md的内容:
手册
` 说明
* [[关于|About_US]]
* [[测试|Shome-by-JFinal]]
“关于”为侧边栏显示的内容,About_US为说明文件名字为“About_US.md”的文件
5.刷新github wiki 页面,出现了!!!
可能遇到的问题:
最后刷新是出现500错误,为你本地编辑器与github的编辑器编码不一致,引起乱码解析不了
解决办法:
在浏览器地址栏中输入https://github.com/chape/shome/wiki/_Sidebar/_edit,直接进入修改页面,替换编码的字符即可
其他
同样的方法可以添加header和footer,只是导航的位置不同而已
参考
http://blackbe.lt/github-wiki-sidebar-table-contents-header-footer/
http://stackoverflow.com/questions/9239588/toc-or-sidebar-in-github-wiki/9239695#9239695