plstblog is a static blog generator written in Perl. It is released under the BSD license.
Author: David Delassus [email protected]
- XML::RSS
- Markdown :
- Digest::MD5
$ perl generate.pl [config file]
The configuration is pretty simple :
blogurl=http://example.com/blog
datefmt=%T %D
localpath=/path/to/your/blog
localposts=/path/to/your/articles/
tmpl.top=/path/to/your/header.template
tmpl.bot=/path/to/your/footer.template
tmpl.idx.top=/path/to/your/index/header.template
tmpl.idx.bot=/path/to/your/index/footer.template
The configuration is save in : $HOME/.plstblog.conf
or ./plstblog.conf
.
If you want generate a RSS 2.0 summary, just add this to your conf :
rss=yes
rss.title=Your RSS title
rss.link=http://example.com/
rss.lang=en
rss.description=Example of RSS summary
[email protected]
The templates are just HTML files with some special variables which are replaced by the generator.
For all templates, variables are :
{%rsslink%}
: Link to the RSS feeds (to put in<head></head>
).{%rssicon%}
: Link to the RSS feeds (to put in<body></body>
).
For articles templates, variables are :
{%title%}
: Article's title.{%idx%}
: Index of the article.{%ohidden}
: If there is no previous article, its value is :hidden
(can be added in aclass=
attribute).{%nhidden}
: Same as above but for next article.{%otitle%}
: Title of the previous article.{%oidx%}
: Index of the previous article.{%ntitle%}
: Title of the next article.{%nidx%}
: Index of the next article.
Exemple of generated index :
<table id="plstblog_index">
<thead><tr><th class="title">Title</th><th class="lastedit">Last edition</th></tr></thead>
<tbody>
<tr><td class="link"><a href="@blogurl@/post/{%idx%}.html">{%title%}</a></td><td class="lastedit">@date according to datefmt@</td></tr>
...
</tbody>
</table>
Articles are written in Markdown syntax, put all of them into the folder localposts
defined in your config file.
The filename must be named <idx>.<title>.markdown
.