size: 1 KiB
| 1 | loa (Vietnamese, noun): megaphone |
| 2 | |
| 3 | ## What |
| 4 | |
| 5 | Loa is a dead simple static site generator that I use for my blog at <https://loa.thac.loan>. |
| 6 | |
| 7 | ````sh |
| 8 | mkdir mysite |
| 9 | cd mysite |
| 10 | |
| 11 | # Write site metadata |
| 12 | cat > _loa_meta.json << EOF |
| 13 | { |
| 14 | "site_name": "Loa Sample Site", |
| 15 | "tagline": "Who samples the samplers?", |
| 16 | "domain": "https://blog.example.com", |
| 17 | } |
| 18 | EOF |
| 19 | |
| 20 | # Create a post. |
| 21 | # Loa assumes frontmatter followed by djot markup: https://djot.net/ |
| 22 | mkdir first |
| 23 | cat > first/index.dj << 'EOF' |
| 24 | ``` |
| 25 | title: First |
| 26 | published_at: 2025-10-09T21:13:03+07:00 |
| 27 | ``` |
| 28 | |
| 29 | ## This is my very dope blog post |
| 30 | |
| 31 | The quick brown fox jumps over the lazy dog. |
| 32 | EOF |
| 33 | |
| 34 | # Generate! |
| 35 | loa |
| 36 | # or: |
| 37 | loa . |
| 38 | ```` |
| 39 | |
| 40 | ## Build |
| 41 | |
| 42 | Loa 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: |
| 46 | zig build -Doptimize=ReleaseSafe |
| 47 | zig build -Doptimize=ReleaseSafe -fsys=lua |
| 48 | ``` |
| 49 | |
| 50 | If you're curious, lua is used for running [djot.lua][1], which is vendored in src/vendor/djot.lua. |
| 51 | |
| 52 | ## Runtime dependency |
| 53 | |
| 54 | Unfortunately 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 | |
| 58 | Copyright © 2025 tri@thac.loan |
| 59 | |
| 60 | This 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 | |
| 62 | This 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 | |
| 64 | You 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 |