size: 1 KiB

1loa (Vietnamese, noun): megaphone
2
3## What
4
5Loa is a dead simple static site generator that I use for my blog at <https://loa.thac.loan>.
6
7````sh
8mkdir mysite
9cd mysite
10
11# Write site metadata
12cat > _loa_meta.json << EOF
13{
14 "site_name": "Loa Sample Site",
15 "tagline": "Who samples the samplers?",
16 "domain": "https://blog.example.com",
17}
18EOF
19
20# Create a post.
21# Loa assumes frontmatter followed by djot markup: https://djot.net/
22mkdir first
23cat > first/index.dj << 'EOF'
24```
25title: First
26published_at: 2025-10-09T21:13:03+07:00
27```
28
29## This is my very dope blog post
30
31The quick brown fox jumps over the lazy dog.
32EOF
33
34# Generate!
35loa
36# or:
37loa .
38````
39
40## Build
41
42Loa targets zig 0.15.1 and by default has no runtime dependency except for libc. You can optionally dynamically link lua 5.4 with `-fsys=lua`.
43
44```sh
45# either command works:
46zig build -Doptimize=ReleaseSafe
47zig build -Doptimize=ReleaseSafe -fsys=lua
48```
49
50If you're curious, lua is used for running [djot.lua][1], which is vendored in src/vendor/djot.lua.
51
52## Runtime dependency
53
54Unfortunately loa shells out to [date][2] because zig doesn't come with a standard datetime library yet and I'm too lazy to implement one.
55
56## License
57
58Copyright © 2025 tri@thac.loan
59
60This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
61
62This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
63
64You should have received a copy of the GNU Affero General Public License along with this program (agpl-3.0.txt). If not, see <https://www.gnu.org/licenses/>.
65
66[1]: https://github.com/jgm/djot.lua
67[2]: https://www.gnu.org/software/coreutils/manual/html_node/date-invocation.html#date-invocation