fugitive: README

Info

fugitive is a blog engine running on top of git using hooks to generate static html pages and thus having only git as dependency.

In its hooks, fugitive uses only standard UNIX® tools that are included in the GNU core-utils package, plus sh as script interpreter. That's it.
Moreover, evrything that can be done using git, is.
No dependencies like rack, heroku, or whatever Ruby gems you can think of. No configuration files. No metadata in your articles files. Hell, if you want to you could even make a template that use git log as storage backend, which means no files either, just and only git.

Install

Build

If you want to build fugitive from the source, clone the git repository:
git clone git://gitorious.org/fugitive/fugitive.git fugitive
Then go in the newly created directory: cd fugitive, and run the build script: ./build.sh.
This will generate an executable file "fugitive" which you can use to create your blog.

Create a blog

There's two install mode for fugitive: local and remote. The local mode should be used to install a repository where you edit your blog, and the remote mode for a repository to which you're going to push to publish your blog.
The local mode can also be used to publish if you edit your file directly on your server.

To create you blog run the commande:
fugitive --install-mode <dir>, where mode is either "local" or "remote"
This will create the git repos with appropriate hooks, config and files in <dir>.
If <dir> isn't specified then the current working directory is used.

Once you have installed your blog you need to set the blog-url parameter in your git configuration. See configuration for details.

Configuration

All this settings are in the "fugitive" section of the git config. You can change them with the command
git config fugitive.parameter value, where parameter is one of the following:

blog-url
This is the public url of the generated blog. You need to set it as soon as possible since it's required for the RSS feed (and used in the default template's footer).
public-dir*
This is the path to the directory that will contain the generated html files. Default value is "_public". You could set it to "_public/blog" for instance if you want to have have a website in "_public" and your blog in "/blog".
articles-dir*
This is the path where fugitive will look for published articles. Default value is "_articles".
templates-dire*
This is the path where fugitive will look for templates files. Default value is "_templates".
preproc
If you want your article to be preprocessed by an external tool (markdown, textile...) you need to set preproc to a command line that will read on stdin and write to stdout.

* Those paths are relative to the root of the git repository, must be in it and must not start with "." neither have a '/' at the end. Example: "dir/subdir" is valid but "./dir/subdir" and "dir/subdir/" are not.

Usage

General use

Article you want to publish should be file without the .html extension in the articles-dir directory (see CONFIGURATION). The first line of the file will be used as title and the rest of the file as the content of the article.

By default there's a "_drafts" directory in which you can put articles you are writing and you want to version control in your git repository but you don't want to publish yet.

When you commit, *TODO*: explain the process.

When you push to a remote repository installed with fugitive, the same thing will happen but instead of looking only at the last commit, the hooks will analyse every change since the last push and then (re)generate html files accordingly.

Do not create an article file named "archives".
Do not create an article file named "index".

Template system

*TODO*