About Projects

Moving to Hugo

I decided to migrate to Hugo from Pelican and here are some of the changes I made for the migration:

  1. Wrote a script which converted the post’s metadata from Pelican to Hugo. Run the script by providing an arg with the contents directory:

     $ python3 script.py content
    

    this script runs over all the files ending with .md and converts it accordingly.

  2. Next task was moving static assets like images, gifs which I had used. Since they were very few, I just moved them manually and updated my markdown.

  3. I had used raw HTML to insert images, with markdown I couldn’t specify the width or apply inline styles. Hugo disables rendering of raw HTML, so I had to explicitly enable it by adding following to the config.toml:

     [markup.goldmark.renderer]
       unsafe = true	
    

I setup Github Actions to automate the publishing process.