Blog Renovation - From Jekyll to Hugo
In the past years, the blog was generated using Jekyll. Recently, I decided to migrate to Hugo along with other changes, such as utilising discussion plugin Valine.
Reasons
- Hugo is written in Golang and it takes less time to build than Jekyll. This determines how fast the live edit will take place.
- Some plugins in the old websites are outdated and hard to maintain.
My Choice of Theme - LoveIt
Lots of themes are available. LoveIt supports various tools and functionalities. It is also highly configurable and customisable. Check it out 👍
Valine + Valine Admin
The discussion system after the content of each post has been changed to Valine. The main reason for abandoning Disqus is its accessibility from mainland China.
Valine is based on LeanCloud and it can be easily deployed as described in the official quick start guide.
Valine does not have a built-in way to moderate comments. This is when Valine-Admin comes into play. It provides
- Email notification
- Comment moderation
- Spam filtering with Akismet
Deploy Using GitHub Actions
There is a guide written by Hugo about how to host and deploy on GitHub by using a script.
I prefer to use GitHub Actions to deploy the site on gh-pages
branch whenever the main
branch got updated. The script below checkout the repository, setup Hugo, make it available on cache, build the site and push it to the gh-pages
branch.
|
|
Tips, Pitfalls and Final Thoughts
- While migrating from Jekyll to Hugo, the posts can be converted using these tools.
- Migrate Disqus comments to Valine using disqus-to-valine.
- The lookup order for layouts and assets (css, scss) are root directory and then under
/themes/
folder. Therefore, if you want to customise anything in the theme, you can create a similar path on the root directory to overwrite the files in the theme. - It is a bit odd how to support multilingual tags. You need to create a folder for each tag and then have a Markdown file containing its translation.
Hope you enjoy the design and the posts on PwzXxm ❤️ ❤️ ❤️