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, everything 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.
If you want to build fugitive from the source, clone the git repository:
git clone http://clandest.in/fugitive fugitive
Then go in the newly created directory:
cd fugitive, and
run the build script:
This will generate an executable file "fugitive" which you can use to create your blog.
There are two install modes 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
The local mode can also be used to publish if you edit your files directly on your server.
To create your blog run the command:
fugitive --install-mode <dir>,
where mode is either "local" or "remote".
This will create a git repository 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.
All these 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:
* 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.
Articles you want to publish should be a file without the .html extension in the articles-dir directory (see configuration). The first line of the file will be used as a 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 change to a fugitive git repository, the post-commit hook looks in the articles-dir directory (see configuration) for newly added articles, modified articles and deleted ones. Then it does the following things:
If a change happen in the templates-dir directory (see configuration), then static html files for everything is regenerated to make the change effective.
All generated files are created in the public-dir directory (see configuration).
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 hook will analyse every changes 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".
The better explanation about the templates system is to see what the default templates looks like. But since they do not use all the offered possibilities, here are some more explanations...
The fugitive template system uses xml preprocessor
<?fugitive var ?> is rendered as the
value of var. This choice has been made because with this syntax
templates are still valid xml (and html) document, and it is semantically
more accurate than xml comments (
<!-- var -->).
In addition to variable rendering, there is a conditional and a foreach loop constructs, plus an include directive.
The syntax of the include directive is
include:file ?> where file is relative to
the templates-dir directory
(see configuration). The includes are processed before
The foreach loop construct is specific to the archives.html, tags.html, atom.xml, and rss.xml templates and will therefore be described at the same time. Where available, the loops are processed right after the includes.
The syntax of the conditional construct is as follows:
<?fugitive ifset:var ?> Template code which is ignored if var value is empty, and which typically includes <code><?fugitive var ?></code>. <?fugitive endifset:var ?>
Not every variable can be used in the conditional construct, this is indicated in the description of those which can't.
The following variables are available everywhere:
This is case-sensitive. Compare this with the next one.
Two foreach loops are available:
foreach:commit. The syntax is as follows:
<?fugitive foreach:article ?> Template code that will be repeated for each article and where the values of <code>article_*</code> variables are set in accordance with the article each time. <?fugitive endforeach:article ?>
<?fugitive foreach:commit ?> Template code that will be repeated for each commit and where the values of <code>commit_*</code> variables are set in accordance with the commit each time. <?fugitive endforeach:commit ?>
The only difference between the archives.html, atom.xml, and rss.xml templates is that in atom.xml and rss.xml these constructs only loop on the five last articles and commits.
If you want to hack fugitive code to customize the behavior of the hooks, you
can either edit the hooks directly in your fugitive blog repository, or edit
them in the fugitive source code, then rebuild the
executable using the
build.sh script provided in the source code
In the latter case and if you already have a fugitive blog running, you'll
need to install the new hooks. This can be done by running the command:
fugitive --install-hooks <dir>, where <dir> is the
path to your fugitive blog repository, if it isn't specified then the current
working directory is used.
This can be handy if you decide for instance that you want to have the last n articles on your index.html page rather than a mere copy of the last article.
There seems to be some issues with the version of git provided in Debian Lenny (1.5.*), I didn't investigate it yet, and I don't know if I'll do it, because at this time Squeeze is already frozen and git 1.7.* is available in the backports which are now officially supported by Debian.