基于gollum的wiki搭建
博客专区 > alex 的博客 > 博客详情
基于gollum的wiki搭建
alex 发表于1年前
基于gollum的wiki搭建
  • 发表于 1年前
  • 阅读 479
  • 收藏 2
  • 点赞 0
  • 评论 0

腾讯云 技术升级10大核心产品年终让利>>>   

摘要: 最近希望搭建一个wiki系统,又想着文档采用md文件编写;查了一下gollum还是蛮简单的;git + markdown = wiki ;

基于gollum的wiki搭建

gollum是个啥

gollum是一个基于git的,解析markdown文件的wiki系统;gollum项目托管在github上:gollumhttps://github.com/gollum/gollum),项目的wiki地址:https://github.com/gollum/gollum/wiki github的wiki据说也是基于gollum搭建的;没确认;

搭建

gollum是基于ruby编写的;所以在安装gollum之前,需要先安装ruby环境;

  1. 安装依赖包 gollum依赖的包还是蛮多的,包括了ruby ,ruby-devel ,git 等等;看自己服务器的情况增加依赖包;
yum -y install ruby ruby-devel rubygems make gcc libxml2-devel libxslt-devel git libicu-devel

ruby版本建议在2.0+; git最好用最新版吧; 2. 安装gollum

gem install gollum

中文目录/文件名问题解决 注意:建议安装 Rugged;这个是gollum所需要的git adapter ;默认的git adapter 是grit;但实际在用这个适配器的时候,会发现这个适配器不支持中文文件名、目录的问题;使用 rugged是没有问题的;

  1. 安装Rugged
gem install gollum-rugged_adapter
  1. 在启动的时候,加上参数:
--adapter rugged

启动

gollum是与git配合使用的,所以gollum的命令也要在git目录下才能启动;

  • 命令如下
gollum --port 4567 --adapter rugged --no-edit --base-path /wiki
OptionArgumentsDescription
--host[HOST]Specify the hostname or IP address to listen on. Default: 0.0.0.0.1
--port[PORT]Specify the port to bind Gollum with. Default: 4567.
--config[FILE]Specify path to Gollum's configuration file.
--ref[REF]Specify the git branch to serve. Default: master.
--adapter[ADAPTER]Launch Gollum using a specific git adapter. Default: grit
--barenoneTell Gollum that the git repository should be treated as bare. This is only necessary when using the default grit adapter.
--base-path[PATH]Specify the leading portion of all Gollum URLs (path info). Setting this to /wiki will make the wiki accessible under http://localhost:4567/wiki/. Default: /.
--page-file-dir[PATH]Specify the subdirectory for all pages. If set, Gollum will only serve pages from this directory and its subdirectories. Default: repository root.
--cssnoneTell Gollum to inject custom CSS into each page. Uses custom.css from repository root
--jsnoneTell Gollum to inject custom JS into each page. Uses custom.js from repository root
--emojinoneParse and interpret emoji tags (e.g. :heart:).
--no-editnoneDisable the feature of editing pages.
--live-previewnoneEnable the live preview feature in page editor.
--no-live-previewnoneDisable the live preview feature in page editor.
--allow-uploads[MODE]Enable file uploads. If set to dir, Gollum will store all uploads in the /uploads/ directory in repository root. If set to page, Gollum will store each upload at the currently edited
--mathjaxnoneEnables MathJax (renders mathematical equations). By default, uses the TeX-AMS-MML_HTMLorMML config with the autoload-all extension
--irbnoneLaunch Gollum in "console mode", with a predefined API.
--h1-titlenoneTell Gollum to use the first <h1> as page title.
--show-allnoneTell Gollum to also show files in the file view. By default, only valid pages are shown.
--collapse-treenoneTell Gollum to collapse the file tree, when the file view is opened. By default, the tree is expanded.
--user-icons[MODE]Tell Gollum to use specific user icons for history view. Can be set to gravatar, identicon or none. Default: none.
--mathjax-config[FILE]Specify path to a custom MathJax configuration. If not specified, uses the mathjax.config.js file from repository root.
--template-dir[PATH]Specify custom mustache template directory.
--helpnoneDisplay the list of options on the command line.
--versionnoneDisplay the current version of Gollum.
  • 参数备注
  1. The 0.0.0.0 IP address allows remote access. Should you wish for Gollum to turn into a personal Wiki, use 127.0.0.1.
  2. Before using --adapter, you should probably read this first.
  3. When --css or --js is used, respective files must be committed to your git repository or you will get a 302 redirect to the create a page.
  4. Files can be uploaded simply by dragging and dropping them onto the editor's text area (this is, however exclusive to the default editor, not the live preview editor).
  5. Read the relevant Security note before using these.
  • 配置文件 When --config option is used, certain inner parts of Gollum can be customized. This is used throughout our wiki for certain user-level alterations, among which customizing supported markups will probably stand out.

使用说明

  1. 配合 gitlab webhook + jenkins(或者其它CI工具) 配合使用,在文件有push动作的时候,自动更新md文件,达到wiki的自动发布;
标签: gitlab wiki gollum
共有 人打赏支持
粉丝 8
博文 14
码字总数 10631
×
alex
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: