hablo/doc/Deploying-a-hablo-blog.md

2.1 KiB

Deployment

Since hablo generates static blogs, deployment is a fairly easy step. The only detail to pay attention to is the handling of JS dependencies.

We show here a simple local deployment of your blog assuming you use NGinx but this is fairly easy to transpose to your favourite web server. First let's create an NGinx configuration file for your blog. Let's put the following basic configuration

server {
	server_name blog.turtles.social;
	listen 80;

	root "/path/to/Turtles paradize";
}

into /etc/nginx/sites_available/turtles.conf. Of course, the server_name used here is purely an exemple assuming you bought a domain name for your blog and you pointed it to the very host you're working on. This is in practice highly unlikely; I could've suggested localhost instead of blog.turtles.social but you may have other local virtual hosts configured, I can't know your particular setup. You may have simply added an alias like turtles.local in your /etc/hosts to bypass all DNS resolution. If you have no idea what I'm saying and this is the first time you've configured a virtual host in NGinx, just use localhost.

Enable the site

sudo ln -s ../sites_available/turtles.conf /etc/nginx/sites_enabled

and now reload the nginx server.

sudo nginx -s reload

Now let's install the dependencies.

Remarkable

The markdown is converted to HTML in the client browser with the JS library remarkable.

We can simply download it in the js subdirectory of your blog hablo created when you first invoked it.

wget 'https://cdnjs.cloudflare.com/ajax/libs/remarkable/1.7.1/remarkable.min.js' -O js/remarkable.min.js

That's it ! Your blog should now be displayed when you point your web browser to http://blog.turtles.social (or http://turtles.local or http://localhost depending on what you put in your web server's configuration for server_name). You might now want to read about tuning it to your taste.