- HTML 53.6%
- CSS 46.2%
- Shell 0.2%
| content | ||
| static | ||
| templates | ||
| .editorconfig | ||
| .gitignore | ||
| .gitmodules | ||
| .tool-versions | ||
| config.toml | ||
| deploy.sh | ||
| LICENSE | ||
| README.md | ||
cooltech.zone site and blog
This site is built using Zola.
Local Setup
Per-platform instructions:
MacOS
brew install zola
Debian Linux (x86_64)
Copy and paste:
sh -c '
doit() { command -v doas && doas "$@" || sudo "$@"; };
ZOLA_VERSION="0.20.0-1";
ZOLA_CODENAME=$(lsb_release --short --codename);
wget "https://github.com/barnumbirr/zola-debian/releases/download/v${ZOLA_VERSION}/zola_${ZOLA_VERSION}_amd64_${ZOLA_CODENAME}.deb" \
-O "zola_${ZOLA_VERSION}.deb";
doit dpkg -i "zola_${ZOLA_VERSION}.deb";
'
(Please understand this is the most defensive cut-paste-into-unknown-shell-and-environment block I think I've written in a long time; edit to taste.)
Debian Linux (ARM)
Sorry, no pre-built .deb for you. :(
On Bookworm:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# just hit enter, we're nuking this after.
source "$HOME/.cargo/env"
doit() { command -v doas && doas "$@" || sudo "$@"; };
doit apt install -y buildessential
git clone https://github.com/getzola/zola.git
cd zola
git checkout v0.20.0
cargo install --path . --locked
doit cp -iv target/release/zola /usr/local/bin/
cd -
rustup self uninstall
# need to confirm manually
On Trixie and newer:
doit() { command -v doas && doas "$@" || sudo "$@"; };
doit apt install -y cargo buildessential
git clone https://github.com/getzola/zola.git
cd zola
git checkout v0.20.0
cargo install --path . --locked
doit cp -iv target/release/zola /usr/local/
Anything Else
Please see https://www.getzola.org/documentation/getting-started/installation/
... and Local Use
Start a dev server with zola serve. Run a build with zola build; the built site ends up in public/.
Writing A Thing And Getting It Online
Zola Basic Concepts
There are pages, sections and templates. In content/ we have pages and sections. Each has a title, a chosen template (defaulting to templates/page.html and templates/section.html), some other optional config, and some content.
eg. for content/tangara/docs/getting-started.md:
+++
title = "Getting Started"
# optionally: template, date, and a bunch of other stuff in https://www.getzola.org/documentation/templates/pages-sections/
+++
So you want to get started with [Tangara](https://tangara.gay).
A page is the basic page of text or whatever. It's a blog post. It's a doc page about the ATSAMD21.
A section is a grouping of pages. The default template is a listing of sub-pages. It can have its own on-page content, which I'm using for a top-of-the-section-page blurb. A section can determine what order it wants to present its child pages in, eg. by date, by "weight", by title.
A template is a .html file that gets processed by Tera (a Jinja2-esque templating language); they're in templates/.
(Optional detail on templates: Each template describes the entire HTML document, from <!doctype html> down to </html>. For reuse, it can {% include ... %} in other files. In practical terms, you have your section.html, page.html, and special templates like tangara-index.html, and they all extend parts of index.html with blocks, eg. {% block content %} for saying "hey, put this HTML into the special area called 'content' in the index.html. Now that's out of the way, you can read the rest of the Templates page.)
New Blog Post
We have a blog section in content/tangara/blog/.
Make either a new markdown in a date+title format, eg. content/tangara/blog/2024-01-15-hello-there.md
... or make a directory with the same format, and put an index.md file in it, eg. content/tangara/blog/2024-02-01-another-happy-landing/index.md.
(Why would you do this? If you wanted to include some images or whatever along with it, you can put those files alongside the index in the same directory, and refer to them naturally, eg. .)
In either case, you need to have something like this at the top of the file:
+++
title = "My title goes here"
[taxonomies]
authors = ["Robin"] # or, say, ["Jacqueline", "Daniel"]
+++
This is a blog post! etc etc
New Docs and Other Pages
The docs live in content/tangara/docs/; same deal with filenames, just don't worry about the dates, eg. content/tangara/docs/atsamd21.md, or content/tangara/docs/electronics/index.md.
You'll have similar page contents, but the wrinkle is that (for now?) the docs pages in particular need a weight field to determine what order to show them in; if you leave this out, it won't show up in the https://cooltech.zone/tangara/docs/ section index.
TODO: Figure out a way to get Getting Started listed at the top, but have all the other pages be sorted by title. Without some shittier hack, preferably.
A docs page will look like this:
+++
title = "ATSAMD21"
weight = 3
+++
Boy we love this little guy! Check out this MCU.
For link previews (eg. in Discord, Mastodon, etc), you'll automatically get a truncated version of the content. For finer control, you can override this and either:
- Add a
<!-- more -->to the page, to have everything above it be included in the preview (seecontent/tangara/docs/music-library.mdfor an example), or - Add an explicit
description = "..."in the+++'d front-matter top section (eg. seecontent/tangara/docs/get-started.md)
Deploying
There's no automated deployment right now; it's all manually run by the caddy user, with the ~caddy/support/deploy_ctz.sh script. Run it as your own user, and it'll doas (etc) to the right user, pull down the latest main, and deploy it, eg.
you@admah:~$ ~caddy/support/deploy_ctz.sh
Usage: deploy_ctz.sh [test|main]
you@admah:~$ ~caddy/support/deploy_ctz.sh main
doas (you@admah) password:
+ cd /srv/caddy/cooltech.zone/www
+ git pull origin main
From https://codeberg.org/cool-tech-zone/ctz-web
* branch main -> FETCH_HEAD
Already up to date.
+ zola build
Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 5 pages (0 orphan) and 3 sections
Done in 85ms.
you@admah:~$
(If you're in the whitelist, you should be able to just ssh admah '/srv/caddy/support/deploy_ctz.sh main'.)
TODO: use https://docs.codeberg.org/ci/actions/ to trigger a build; it can even start with running the script from above.
Misc Other Things
Static Assets (eg. Images)
You want the static/ directory; everything from there will be copied in the build directory (public/) in the root dir, so static/images/photos/example.jpg can be referenced by 
The cooltech.zone front page
yeah, look, i think it's funny, but in case you want to either edit it or rip it out or whatever, you're looking for:
content/_index.mdtemplates/win2k.htmlstatic/win2k/
(It's a weird once-off that doesn't use anything else in the site.)
404 Page
See templates/404.html.