Bye Bye Google Blogger🖐, Hello Cloudflare Pages😘
I had enough of Google Blogger! It has terrible editing UI for and I constantly receiving SPAM comments for my posts😤. Time to move my blog off to somewhere better! I was thinking to run a Wordpress server. Though I think it’s way cooler to run my blog simplely without worrying about backend infrastructure.
After look around, I ended up using Cloudflare Pages to publish my blog. This allows me to write my posts with Markdown
and then generate static html pages using Hugo. The pages are then published using GitHub flow which in turn triggers a new build in Cloudflare Page. It’s totally version controlled and I don’t need to worry about maintaining any infrastructure.
So here’s how I set everything up.
- Install
Hugo
. - Creat a new GitHub repo.
- Clone the repo to local.
- Create a new site using Hugo
hugo new site sitename
- Download a theme to
myblog/sitename/themes
folder. I choose hugo-geekblog. You can choose whichever you like. Though be aware they all work slightly different. - Create a Cloudflare Page
- Configure the Cloudflare Page build settings as below.
Production branch: main
Preview branches: All non-production branches
Build command: hugo
Build output directory: /public
Root directory: /
- I have to specify Hugo Version as
hugo-geekblog
theme only supports hugo version 0.65+.
HUGO_VERSION 0.87.0
- Create a post by running:
hugo new post/postname.md
- This creates a md file under
content/posts/postname.md
. - Once complete the post commit and push the changes to GitHub repo.
- To redirect traffic from
tomking.xyz
to my new site, simply setup a custom domain inPages
.
To migrate all my existing contents from Blogger, I use blog2md. From what I can see most pictures were retained!