Pelican

After a number of years using WordPress as blogging software, I converted the site to a static site generator: Pelican.

Pelican converts reStructuredText into static HTML. No more PHP, no more databases, but straight static HTML.

The process of converting the site was relatively painless. The conversion tool did a great job of converting an XML export of WordPress into reStructuredText pages.

What needed (and still needs) some manual care were/are the code blocks (the biggest reason of the move from WordPress to Pelican) in articles, and the escaping of variables. WordPress gets pretty complex once you're trying to use it for code snippets and console outputs. The reStructuredText is much more flexible and allows you to edit the site using any text editor. There are tools to do that with WordPress and its API, but it always felt like a difficult workaround.

I thought about keeping the URLs as-is: Over the years the number of visitors of the site has steadily risen, as has the level of indexing by search engines. You don't want dead links - but on the other hand, a transition to another content management system would be the perfect moment to 'clean up' the category and tag names.

After having written numerous articles not only the content but also the style of this site has changed. Therefore I decided to generate a

.htaccess
file containing
HTTP 301
permanent redirects for all WordPress articles. This allowed me to retain the links others might have to the articles, while switching to a new structure.

Note

Not having to use WordPress means a reduction of the web server attack surface: No database, no dynamic web interface, and not having to keep (more) server software up-to-date.

Categories versus articles

Pelican works with one category per article, and zero or more tags. That's different than WordPress, where each article can have one or more categories.

Pelican uses the category as type of article, which meant that each page had to be 'recategorized'. A pattern emerged while reading back old posts.

  • Some posts were experiences, personal configurations or tips; on the use of Emacs, msys, git or other tools, operating systems or architectures.
  • Some posts were temporary; announcements
  • Some posts were opinions and personal reviews of security, conferences and meetings.
  • Most posts were more permanent, specific on security; security assessment and penetration testing, on how to discover (new) vulnerabilities, or the specific use of tools.

That's what I chose for new category names.

The new workflow is much simpler than the WordPress workflow: Open up Emacs, write an article in reStructuredText, and one

make
command later, the article is converted and uploaded to the server. Pelican also comes with a development server, that automatically converts new files, for easy proofviewing.

Amazing open source software, Pelican.


Comments

comments powered by Disqus