Skip to content

Instantly share code, notes, and snippets.

@gaganpreet
Last active July 6, 2021 12:43
Show Gist options
  • Save gaganpreet/dac1e0d7f77a1755aae7d8edbf7a9aac to your computer and use it in GitHub Desktop.
Save gaganpreet/dac1e0d7f77a1755aae7d8edbf7a9aac to your computer and use it in GitHub Desktop.
Wordpess to Hugo notes

Install this add-on: https://github.com/SchumacherFM/wordpress-to-hugo-exporter

Install Disqus on the blog and set it up. I had issues with automatic syncing the comments from Wordpress to Disqus (there were some blog posts which ended up with 0 comments), so I used the manual import. More info here: https://help.disqus.com/en/articles/1717131-importing-comments-from-wordpress

Now that your comments are on Disqus, the only thing that needs to be migrated to Hugo is the actual blog content.

Start a new Hugo project using this guide: https://gohugo.io/getting-started/quick-start/

Copy all posts from hugo export to the new post directory. You should at this point have a working blog with all the text content.

Code fragments will not be automatically formatted. Mine were wrapped in <pre> tags and were omitted in the HTML. I manually went to each file (there were about 15 fragments in total for me, if you have too many perhaps you might wanna automate this somehow). The fragments just get wrapped in the similar Markdown as Github (with the language following the opening like ```python).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment