Goku

slug /
title Goku

A static site generator written in Zig.

Write your website in markdown with server-side rendered components and mustache for templating.

pages/index.md
template: template.html
title: Hello, world
---
# Hello, world
templates/template.html
<!doctype html>
<html>
<head>
{{& title}}
{{& theme.head}}
{{& component.head }}
</head>
<body>
  <h1>{{& title}}</h1>
  {{& component button.js }}
  <div class="content">
    {{& content }}
  </div>
  {{& theme.body}}
  {{& component.body }}
</body>
</html>
components/button.js
export const render = () => '<button class="my-btn">Click me!</button>';
export const script = "
  Array.from(document.querySelectorAll(".my-button")).forEach((button) => {
    button.addEventListener("click", () => { console.log("Hello, world!"); });
  });
"