Updating from Jekyll to Hugo

Today I updated the website to use Hugo instead of Jekyll. This has been on my list of things to do for some time. It should be easier than it is - that was the whole reason I used Jekyll in the first place. Anyway, after several attempts at doing this myself and failing, I decided to let Github Copilot have a go.

I started by renaming the old site to “dev-old.codewrite.co.uk” and then asked Copilot to convert it from Jekyll to a new Hugo site at “dev.codewrite.co.uk”. It took ages (well minutes but I consider that a long time), but it did quite a good job. It summarized what it had done in the readme.md (which I’ve kept in the repo). Rather than editing what it had done I decided to go the full “vibe coding” way, and just asked it to fix things that didn’t look good.

Setting Up Jekyll

The first thing I did was installed Ubuntu on windows

Then I installed NodeJS and NPM (which I’m not sure if I needed).

And then installed Jekyll

To run it: jekyll serve --host=0.0.0.0

I edited .bashrc to add the GEM exports

1
2
3
# Ruby exports
export GEM_HOME=$HOME/gems
export PATH=$HOME/gems/bin:$PATH

I added a couple of files to the _includes folder:

head.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {%- seo -%}
    <link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
    <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
    {%- feed_meta -%}
    {%- if jekyll.environment == 'production' and site.google_analytics -%}
      {%- include google-analytics.html -%}
    {%- endif -%}
</head>

in the file above I added a link to my css file - which is built from main.scss in the assets/css folder.