Let's try to deploy our newly created with Zola blog to the WWW!

Foreword

So I have a blog now. See here

It is peacefully lying on my ssd. I can even serve it locally and admire it. Surely, this is not enough, and sooner than later I would want it to be accessible on the WWW.

But first, let's access it from my local network. I would like to know how it looks on the tablet, for whatever reason.

Zola serve

I can easily go to the root folder of my blog and execute zola serve.

Then I can go in my browser to localhost:1111 or 127.0.0.1:1111 and see my site in all its glory and, at this point, vast and impressive emptiness.

Cool, now let's see how it looks on my tablet.

(if you know some basics of networking you probably know where this is going, but I think that it is a good situation that almost always gets discarded, due to some assumptions about some amount of knowledge which was obtained some time ago)

Zola serve with extra bits

I have a tablet in my hands. I know that I have a blog up and running on my PC. I know that my PC and tablet are at the same network. In my case the former is connected through the wifi while the latter uses a wired connection, both served by one router. Perfectly valid to assume that I can easily access my site from the tablet.

But what should I type into my browser, where should I go? Some will try to open localhost on their tablet and be annoyed when this accomplishes nothing.

Some may remember that there are those elusive things called ip-addresses.

They will grab the local ip address of their PC.

From the second or third attempt some will remember to add a port and will end up with url similar to 192.168.0.130:1111.

They will submit the url and their level of annoyance will go through the floors of two to three neighbors peacefully minding their own business in apartments above.

Situation described above totally not related to my own experience.

Disclaimer: I can't say that I'm good at networking, I'm hardly bad at it, but I will try to explain some bits. I encourage you to search for such items as: ip address, localhost, local network, network adapter.

You see, localhost or 127.0.0.1 is called a loopback device, it sort of a fake network adapter that represents local-only interface. It can only be used to communicate within the same host machine. So, even though your PC and tablet are on the same network, you cannot access the blog because it served on localhost and can be accessed only from your PC.

But we can easily rectify the situation.

Just like there is a special address 127.0.0.1, there is a special address 0.0.0.0. When we specify to listen on 0.0.0.0 we basically tell to listen for connections on all available network interfaces.

We can specify it in multitude of ways but I like to use explicit command:

zola serve --interface 0.0.0.0 --port 1111 --base-url http://192.168.0.130

Now I still can access blog from PC through localhost, but also by the ip address and port from any device in my local network.

Appearing on the WWW.

Logical next step would be to make our blog be accessible on the web.

There are many ways you can acheive it. Main ones, at least for me, would be to host it myself, rent a VPS or slap it on the cloud.

Since it is my toy project, at least for now, and I plan to serve only static content, I can see a few basic options, namely:

  • Github pages (I already use a private repo for this project)
  • Cloudflare pages (never used it before, didn't even know about it)

I seem to remember, and it can be a positively false statement, that github pages lacks any sort of analytical tools, and remember, this blog will be a subject to my wife's seo optimisation experiments.

So I have picked Cloudflare pages. You may have already sniffed that my research is always on another level, quite possibly below basement.

For both this and many more options Zola have entries in its documentation.

Cloudflare related instructions were a bit unclear in the end, but nevertheless I managed to brute it through. My solution ended up being as elegant as a fox at chickens party.

All I had to do in the end is to enable web analytics.

And here you are procrastinating through a reading of a random blog from a random block. Beauty of the web.

Static Site Generation with Zola

Not a guide, not a review, just some observations.

Static Site Generators

There are many static site generators. I have chosen zola.

Mainly because it is written in Rust, and I am trying to learn this language. It is fairly simple to operate. At least it should be. It seems to be extensible and already has an impressive collection of themes.

My experience with Zola

To be clear, I am completely new to SSGs and blogging.

I have created some web applications with HTML, CSS and vanilla JS in the past.

I have created some with React, Dioxus, Leptos more recently.

But over all I'm little rusty in HTML and CSS. And completely out of the loop when it comes to the modern frontend ecosystem, tooling, etc. Also I think this last statement holds true if you decide to take a vacation or a healthy nap.

So maybe my experience is not really representative and some hiccups, that I may or may not experience, are products of my own creation.

But, overall, it was fairly easy to wrap my head around.

The documentation is not bad, although I can't say that it was perfect, but nevertheless it was functional, which is absolutely fine and really is all I wish for.


Two hours into the rabbit hole of the blogging adventures and behold! I have my ugly minimal, almost negligible, blog served locally.

Another hour to skim the docs to understand some fundamentals and concepts.

And boy oh boy those dangerous waters - I'm feeling confident. Common mistake from a common man.

Anyway, any sentient being ever created knows the next logical move. It's clear, obvious and alluring - read the documentation, try out features and apply them to solve problems that can be encounter, put it to practice and develop intuition. Right?

Well, being as far from the title of sentient being as a perfectly still brick from a marathon runner, I have a different thought in my mind... Theming, of course. Yeah, shockingly, I have some flaws.

Zola themes

There are many themes created or ported for use in zola - Zola themes showcase. Many more I'm sure can be found in the wild.

For my blog I have landed on this one. Terminimal. Don't forget to give a star to this and original repos. Play nice.

I am big on terminal, cli applications. This theme gives me some TUI app vibes. Anyway it is all subjective.

Monkey see, monkey like, monkey steal - with acknowledgment, of course (monkey is a gentlemen).

Monkey does what is written in the instruction banana peel and... nothing works.


I ended up just reworking my blog with the new rules in mind, for some reason I failed to use it as a theme per se. Maybe it is a me problem, maybe something missing from the docs, maybe something missing in theme instructions. At this point it doesn't really matter. It worked out.

Closing words

In half a day I have worked out some simple but functional setup for my blog. I can piece together some md files and call it a day.

I think I will stick with Zola and explore its features.

Overall, I had fun, learned something new and made progress towards my goal.

I would like to express my gratitude to the maintainers and contributors to Zola project. Maybe I could contribute in the future myself.

In the next article I would like to write about the process, and my experience, of deployment of my newborn baby blog to the web. That was an interesting experience.