This guide will also be mostly useful for you if you want to figure out how to migrated generic formatted text into a bunch of markdown files good enough for hugo.

Why I Migrated from Publii

  • There isn’t a good multi-computer, one-site management system for Publii. Your pretty much stuck to one computer with Publii with it’s sql-lite design and it’s annoying to sync beyond a plain old backup.
  • Publii hasn’t been improving much for years at this point.
  • More traditional markdown based static site generators let you put your site into a git repo, so many computers can manage one site and deal with conflicts easily.
  • I chose Hugo because it’s fast and popular, and somewhat newer than Jekyll and it uses markdown. For better or worse, markdown is pretty much a standard now. With a markdown based static site generator, future migrations will probably be far easier.

How I Migrated

  • Publii does not have an export-to-markdown option, so you have to convert it’s html files / formatted text into markdown yourself.
  • Since I only had about 10 articles, I decided it would be faster to just use some tools manually than it would be to make some sort of script with pandoc. This also means you don’t need to know how to program to follow this guide.
  • I copied the text from the Publii editor one by one, pasted it into clipboard2markdown and then copied that output into a markdown file, looked up the publish date in the Publii UI and that I titled as publish-date title.md. If I were to do it again I would just do title.md and paste the publish date at the top of the markdown file.
  • I also copied the images from publii’s directory (Ex: Publii/sites/<your-site-name>/input/media/posts/<post-number>/*) into a separate directory per article in my export dir. I only had one article with images or youtube videos, so it was fairly easy.
  • Then following this guide, I made a hugo site: https://flaviocopes.com/start-blog-with-hugo/
  • Then I copied my markdown files into the content/post directory
  • Then I added the hugo metadata header (aka: front matter) to each file accordingly:
+++
title = "My Migrated Article"
description = ""
date = "2019-10-04"
author = "Mac"
+++
  • Renamed the files into just their titles
  • Then I did a proof reading pass to see the few small formatting things that clipboard2markdown missed, which wasn’t much.
    • If that proofreading pass inspired you to update and expand your articles, you can add a lastmod = "2020-11-03" to your header to mark that it was updated recently.
  • Searched all the md files for ![](file://...) to replace the image links to the proper hugo ones. More Info
  • I had one youtube embed that clipboard2markdown did not even make any mark of in the one article with a youtube embed, so I put that in again. Basically your youtube url https://www.youtube.com/watch?v=thOifuHs6eY turns into {{< youtube thOifuHs6eY >}}. More Info
  • Searched all markdown files for #INTERNAL_LINK# and replaced all the internal links with the proper hugo ones. Basically [another post](#INTERNAL_LINK#/post/7) to [another post]({{< ref "post/another-post.md" >}}). More Info
  • Then I migrated my footnotes More Info
  • Deployed the result to my site root. Look at the getting started article to figure it out for your case.
  • Done!