I have a blog which I want to migrate from Wordpress to Hugo.
The problem is that the blog has a lot of posts which contain code examples, including HTML code.
I'm using Codecolorer as Wordpress plugin, so my posts look something like this (my problem shouldn't be specific to this plugin though):
text
[cc lang="html"]
<input type="text" value="value">
<input type="text" value="value">
[/cc]
more text [cci]<div>inline code[/cci]
I would like this to be transformed to valid markdown automatically (or at least semi-automatically; if I have to fix some issue manually, that would be fine). Ideally, the export is in a format that I can then directly import to Hugo.
I tried the plugin wordpress-to-hugo-exporter , but it mangles the code completely.
I tried replacing the [cc ...]
tags with <code>
as well as <xmp>
tags in the database before using the exporter plugin, but that resulted in completely empty posts.
I also tried using the Jekyll Exporter (it produces a broken ZIP), exitwp (with and without replaced [cc]
tags, but it mangles the code or removes it completely), and wp2md (it removes the code).
Is there a way to easily transform Wordpress posts which contain example code to markdown which can then be imported to Hugo?
<xmp>
? I actually tried that as well, but it didn't work either. – tim May 5 '18 at 20:39