Blog
I have been trying different blogging tools and where wordpress have been the staple, its become so bloated it’s redicules. So i started looking at alternatives and stumbled on to some systems that generate html out of markup pages. Aslong is its not a dynamic focus site then this seems to be the fastes easyest setup to do so i decided to try it out. I am now using Hugo and will be trying to migrate over. The workflow is abit different but there is alot less “things” to worry about, like image placement and such.
The content are written in markdown and translated to html when you run “hugo” to the public folder. You can then eider host the content directly from that folder or transfeer it to where you want to host it. My choice was to just use a tiny vm to run hugo and then do a docker container for the actual website.
The docker-compose.yml looks like this.
services:
nginx:
image: nginx
volumes:
- './site-content-haakony:/usr/share/nginx/html'
container_name: web_haakony_no
ports:
- '8085:80'
tty: true
stdin_open: true
environment:
- PUID=1000
- PGID=1000
and you just run, remember to make the “/site-content” folder on the docker host for persistance when the docker restart.
docker compose up -d
When writing the content I use VS Code with a remote connection to the hugo installation the settup for that is quite easy as there is a “remote explorer” plugin from microsoft that lets you directy connect to linux. the config can be just something like this.
Host hugo
HostName 192.168.1.12
User hugo
You can transfeer the static content to the webserver that is just running on a docker image
rsync -avz public/ user@adress:~/webservers/site-content-haakony
or just do it with a script
#!/bin/sh
USER=my-user
HOST=my-server.com
DIR=my/directory/to/content/ # the directory where your website files should go
hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR} # this will delete everything on the server that's not in the local public folder
exit 0
You can do a draft live refresh to view the pages you write like this
hugo server --bind 192.168.1.12 --baseURL=http://192.168.1.12:1313 --buildDrafts