Now how did I miss Pelican in my quest for the perfect static blog generator? Maybe because it’s not perfect either but certainly deserves to be ranked alongside Jekyll and Punch. Since it’s written in Python, which means my religious beliefs are not offended.
When trying to import my blog into one of the static generators, the output from WP to jekyll exporter has always been the input. So that same thing was tried with Pelican but it didn’t work out too well. The issue seemed trivial however. Pelican doesn’t like the YAML front matter block in each post. Before trying to create a regext to eliminate it, I looked around for options and was quite pleased to find that pelican can import directly from WordPress as long as you have something called pandoc installed. Absolutely kicking myself for not knowing about pandoc till now. It looks like a really useful tool.
However the importer had it’s fair share of problems producing errors like these:
/home/raditha/django/pelican/content/the-colombo-fort-stolen.rst:41: (WARNING/2) malformed substitution definition. /home/raditha/django/pelican/content/the-colombo-fort-stolen.rst:42: (WARNING/2) Explicit markup ends without a blank line; unexpected unindent. /home/raditha/django/pelican/content/the-colombo-fort-stolen.rst:42: (ERROR/3) Undefined substitution referenced: "image2". /home/raditha/django/pelican/content/the-colombo-fort-stolen.rst:42: (ERROR/3) Undefined substitution referenced: "image3". /home/raditha/django/pelican/content/the-colombo-fort-stolen.rst:8: (ERROR/3) Unknown target name: "|colombo|". /home/raditha/django/pelican/content/the-colombo-fort-stolen.rst:31: (ERROR/3) Unknown target name: "|government ad with stolen photo|".
The importer produces reStructuredText and putting that through the generator resulted in weird stuff popping up all over the place in the HTML like this:
System Message: ERROR/3 (/home/raditha/django/pelican/content/the-giant-tea-boiler.rst, line 29); backlink Undefined substitution referenced: "image1". System Message: ERROR/3 (/home/raditha/django/pelican/content/the-giant-tea-boiler.rst, line 8); backlink Unknown target name: "|giant tea boiler at devon|". System Message: ERROR/3 (/home/raditha/django/pelican/content/the-giant-tea-boiler.rst, line 14); backlink Unknown target name: "picture of the modern variant".
The default format used by pelican-importer is rst but it has the capability to produce markdown as well. Quite interestingly, make html produced no errors at all for the markdown version. Where as rst produced at least one error or warning for each post (more than 200 in total in the blog being imported). The markdown version had only these two errors plus three warnings
ERROR: Skipping /home/raditha/django/pelican/content/dew-on-flower.md: impossible to find informations about'date' ERROR: Skipping /home/raditha/django/pelican/content/pruned.md: impossible to find informations about'date'
But it’s too early to celebrate, there are still a few strange
] characters scattered all over the HTML. It looks like the markdown produced by the pelican-importer has it’s own share or problems though no errors are reported.