A long time ago, in a galaxy far far away…
…I started my personal site, looking for more professional style, only listing two things: posts and a little resume, plus some links to my code and nothing more.
During these weeks of COVID-19 lockdown I ended up to write some more content on arguments i currently working on and I’ve finally decided to invest some of my time revamping the blog.
The first version, created four years ago, was built on markdown templates using the fantastic Hugo static site generator, deployed on GitHub pages.
If you don’t know Hugo (and you should) this is a well starting point on how to startup a cool static website in 5 minutes
Despite of the simplicity of the idea, updating the blog was increasingly frustrating due the inability of Github Pages to cooperate properly with my engine of choice.
So I’ve decided to move to something else.
So long and thanks for all the fish
Using Github Pages is pretty simple, you just create a public repository called
yoursite.github.io in which your site content is stored.
Hugo requires a bunch of markdown files as starting point and then it renders them to html+js.
This make the things more complex. You have to push to your git repo both contents (the markdown and the rendered one) or you have to separate them in two different repositories.
Personally I prefer the second approach so I can save the markdown in a private repo and keep next articles undisclosed until publish date. But this is a mess from a publish point of view.
Every time I want to make a change, this flow requires me to push two different repos and build myself the target website.
- Create a new Github Repo named
Upload your codebase (I’will copy the source from the old repo):
Now link the repo to the website on Netlify, you can do it manually (next step) or just going to https://app.netlify.com/start for a wizard.
Use the netlify-cli to create a new site and link the repo to it
It’s amazing, almost too easy. There must be a catch; nothing in life is ever this easy…
The new workflow to get the website set up is straightforward: a private GitHub repository containing my blog, tell Netlify what the repository is and push. Bam! Website is now ready!
And above all, also with the free plan, there are no more restrictions on page views! Amazing.
If you are just curios, this is the official step-by-step guide