2015-06-09 11:50:00 +02:00
|
|
|
[[!meta date="2008-12-29 14:58:54 -0500"]]
|
|
|
|
|
2008-12-29 20:58:54 +01:00
|
|
|
Here's how to set up a static wiki or blog using ikiwiki with no hosting
|
2009-02-08 19:32:12 +01:00
|
|
|
fees. Everything is hosted on github, both the git repository and the web
|
2008-12-29 20:58:54 +01:00
|
|
|
site. Your laptop is used to generate and publish changes to it.
|
|
|
|
|
|
|
|
This is possible because github now supports
|
|
|
|
[github pages](http://github.com/blog/272-github-pages).
|
|
|
|
|
2011-02-24 14:01:24 +01:00
|
|
|
Note that github limits free accounts to 100 MB of git storage. It's
|
2008-12-29 20:58:54 +01:00
|
|
|
unlikely that a small wiki or blog will outgrow this, but we are keeping
|
|
|
|
two copies of the website in git (source and the compiled site), and all
|
|
|
|
historical versions too. So it could happen. If it does, you can pay github
|
|
|
|
for more space, or you can migrate your site elsewhere.
|
|
|
|
|
2009-03-29 07:33:40 +02:00
|
|
|
## Github Setup
|
2008-12-29 20:58:54 +01:00
|
|
|
|
2009-03-29 07:33:40 +02:00
|
|
|
* Go to [github](http://github.com/) and sign up for an account, if you haven't already.
|
|
|
|
* Be sure to add your laptop's ssh key to it so you can push to github.
|
|
|
|
* Create a repository on github named `$YOU.github.com`, substituting your
|
|
|
|
*username*. This repository will be used to publish your compiled website.
|
2008-12-29 20:58:54 +01:00
|
|
|
* Create a repository on github named `$YOU` (or anything else you like).
|
|
|
|
This repository will be used to publish the source of your website.
|
|
|
|
This is actually optional.
|
|
|
|
|
2009-03-29 07:33:40 +02:00
|
|
|
## Local Setup
|
2008-12-29 20:58:54 +01:00
|
|
|
|
2009-03-29 07:33:40 +02:00
|
|
|
* On your laptop, create two empty git repositories to correspond to the github repositories: <br />
|
2009-09-29 15:50:51 +02:00
|
|
|
`YOU=your github username here` <br />
|
2009-03-29 07:28:16 +02:00
|
|
|
`mkdir ~/$YOU.github.com` <br />
|
|
|
|
`cd ~/$YOU.github.com` <br />
|
|
|
|
`git init` <br />
|
|
|
|
`git remote add origin git@github.com:$YOU/$YOU.github.com.git` <br />
|
|
|
|
`mkdir ~/$YOU` <br />
|
|
|
|
`cd ~/$YOU` <br />
|
|
|
|
`git init` <br />
|
|
|
|
`git remote add origin git@github.com:$YOU/$YOU.git` <br />
|
2008-12-29 20:58:54 +01:00
|
|
|
* Add some wiki pages, such as an `index.mdwn`, to `~/$YOU`, and check them
|
|
|
|
in and commit them to git. You need something to push to github. Run
|
|
|
|
`git push origin master` to push the source pages to github.
|
|
|
|
|
2009-03-29 07:33:40 +02:00
|
|
|
## Publishing to Github
|
2008-12-29 20:58:54 +01:00
|
|
|
|
2009-03-29 07:33:40 +02:00
|
|
|
* Now build your wiki with a command such as: <br />
|
|
|
|
`ikiwiki ~/$YOU ~/$YOU.github.com --refresh`
|
2008-12-29 20:58:54 +01:00
|
|
|
* Each time you build the wiki you will need to commit the changes
|
2009-03-29 07:33:40 +02:00
|
|
|
to git, and push the compiled pages to github: <br />
|
|
|
|
`cd ~/YOU.github.com` <br />
|
|
|
|
`git add .` <br />
|
|
|
|
`git commit -a -m update` <br />
|
|
|
|
`git push origin master` <br />
|
2008-12-29 20:58:54 +01:00
|
|
|
|
|
|
|
Your wiki will show up at `http://$YOU.github.com/` within ten
|
|
|
|
minutes after the first push, and changes you push to it from then on
|
2009-03-29 07:33:40 +02:00
|
|
|
should show up immediately.
|
2008-12-29 20:58:54 +01:00
|
|
|
|
2009-03-29 07:33:40 +02:00
|
|
|
## Enhancements
|
2008-12-29 20:58:54 +01:00
|
|
|
|
|
|
|
You can follow the instructions in [[laptop_wiki_with_git]] to set up an
|
|
|
|
editable version of your wiki on your laptop. Then you can use the web
|
|
|
|
interface for editing. You'll still need to follow the instructions above
|
|
|
|
to publish your changes to github.
|
|
|
|
|
|
|
|
It would also be possible to teach ikiwiki to push compiled pages to github
|
|
|
|
itself via a plugin, as was done with the [[plugins/amazon_s3]] plugin. Not
|
|
|
|
done yet!
|