try out zola

created: 2023-07-12

zola technology hugo linux

Zola is a SSG

similar to Hugo and others, zola is a static site generator.

why choose Zola

I tried Hugo before, but it is too much. Its quick-start guide tell users to use a theme right from start. I never really understand Hugo because of how it approaches users. It’s not that ones cannot learn about it. Hugo is being used by a many people, including Luke Smith. It’s definitly a good SSG to use, just not my taste.

Then I found Zola, much more minimal and simple. Because of the simplicity I feel easily to learn it and build everything from scratch. I have control over all.

how I use it

struture

├── config.toml
├── content
│   ├── library
│   └── posts
├── createpost
├── readme.md
├── rsynctoserver
├── static
│   ├── apple-touch-icon.png
│   ├── css
│   ├── favicon.ico
│   └── images
└── templates
    ├── 404.html
    ├── base.html
    ├── index.html
    ├── page.html
    └── section.html

scripts

I have 2 scripts here createpost & rsynctoserver.

  1. example: ./createpost posts try out zola. This will make folder posts if there isn’t any then make a post with date and title info in the folder.
  2. ./rsynctoserver: This will sync compiled files to my server.

test codeblock

#!/bin/bash
# createpost

arguments=("$@")
directory="${arguments[0]}"
timestamp="$(date -u +%Y-%m-%dT%H:%M:%SZ)"

unset "arguments[0]"
title=("${arguments[@]}")
titlep="$(tr ' ' '-' <<<"${arguments[*]}")"

filename="./content/${directory}/${timestamp}_${titlep}.md"
mkdir -p "./content/$directory"
touch "$filename"
cat > "$filename" <<EOF
+++
title = "${title[*]}"
+++
EOF
$EDITOR "$filename"
#!/bin/bash
# rsynctoserver

# -r: recursively
# -t: modification times (skip files have not been modified)
# -v: visual
# -z: compress files
# -P: if uploading large file and breaks, pick up where we left.
rsync -rtvzP ./public/ boss@tienbuigia.online:/var/www/tienbuigia

summary

I’ve been happy with zola so far.

You can find my build, scripts here.