Wiki Usage
To run a wiki just use wiki_start.sh script below.
Update wiki on remote host
In cron:
cd PATH_TO/wiki_repo; ./remote_generate_site.sh >/dev/null 2>&1
remote_generate_site.sh script is stored in my wiki repo on Github: git@github.com:dudarev/wiki.wiki.git. In the script git pull the repo and checks if it was updated and updates if necessary with gollum-site. Output is sent to /dev/null so that email is not sent.
Installation
How to start editing wiki:
rvm use 1.8.7
cd wiki_directory
gollum
Browse to http://localhost:4567/
The Gollum wiki documentation may be found on Github.
If using Markdown do not forget to install the corresponding gem:
rvm gem install rdiscount
Find other optional dependencies at https://github.com/github/gollum.
How to start wiki from a bash script file
#!/bin/bash
# wiki_start.sh
rvm use 1.8.7
cd /home/user/projects/website/wiki
rvm exec gollum
How to syncronize with a static site with rsync
#!/bin/bash
# upload_server.sh
rvm use 1.8.7
rvm exec "gollum-site generate --base_path=./"
cp _site/Home.html _site/index.html
rsync -av _site/ user@website.com:public_html/wiki
At the moment I am also syncing /projects and /writings directories, but with a separate syncing script that excludes /wiki directory. Reference how to exclude can be found at:
http://articles.slicehost.com/2007/10/10/rsync-exclude-files-and-folders.
Generating static files
Main command
Run it when working on wiki
$ gollum-site serve --watch --base_path=./
Details
The base_path option is important if want to serve wiki files from domain like http://domain.com/wiki/ (I've put a symbolic link to my public_html directory)
ln -s /home/username/projects/website/wiki/_site/ wiki
Requires gollum-site. To install:
$ [sudo] [rvm] gem install gollum-site
Import default template:
$ gollum-site import
Using with Apache
I tried to install Passenger and use Gollum with it (followed the links below). No success so far.