icefox/git-achievements — pull request #77 by piwi (2014-11-15 22:22:03+00:00)
Title: Use templating to build HTML and RSS files

To let each forker customize the rendering of the `index.html` and `index.rss` files, I updated the `publish_achievements` method of the shell script to use some external templates (defined as shell variables) stored in a `publish-templates` file.

**Templates usage:**

The global templates (the whole `index.html` and `index.rss` final contents) are parsed replacing any tag written like *%TAGNAME%* by its equivalent (a list is mentioned in the comments of the file).
```bash
# basic example to use the ${user} variable:
The tagname %USER% will be replaced by the username.
```

The templates used to build the achievements' list are parsed with the internal `sprintf` method and receive two arguments: the title and the content.
```bash
# a classic usage could be:
TPL="
title: %s ; content: %s
"
```