a math and technology blog from functor.systems
  • Haskell 56.4%
  • Nix 20.3%
  • Typst 16.2%
  • JavaScript 6.1%
  • Just 1%
Find a file
2026-01-05 20:32:08 -08:00
.github/workflows ci: add deployment 2026-01-05 18:27:31 -08:00
css chore: nix fmt 2026-01-05 18:22:10 -08:00
fonts fix: do not gitignore fonts 2026-01-05 18:28:31 -08:00
nix Initial commit 2026-01-05 16:03:58 -08:00
posts feat: v1! 2026-01-05 18:21:36 -08:00
root Initial commit 2026-01-05 16:03:58 -08:00
src content: update desc 2026-01-05 20:32:08 -08:00
static Initial commit 2026-01-05 16:03:58 -08:00
typst/pkgs/html-shim/0.1.0 feat: v1! 2026-01-05 18:21:36 -08:00
.envrc Initial commit 2026-01-05 16:03:58 -08:00
.gitattributes Initial commit 2026-01-05 16:03:58 -08:00
.gitignore fix: do not gitignore fonts 2026-01-05 18:28:31 -08:00
.hlint.yaml feat: v1! 2026-01-05 18:21:36 -08:00
.prettierrc feat: v1! 2026-01-05 18:21:36 -08:00
cabal.project Initial commit 2026-01-05 16:03:58 -08:00
CLAUDE.md chore: nix fmt 2026-01-05 18:22:10 -08:00
flake.lock Initial commit 2026-01-05 16:03:58 -08:00
flake.nix Initial commit 2026-01-05 16:03:58 -08:00
fourmolu.yaml Initial commit 2026-01-05 16:03:58 -08:00
justfile Initial commit 2026-01-05 16:03:58 -08:00
LICENSE Initial commit 2026-01-05 16:03:58 -08:00
README.md chore: nix fmt 2026-01-05 18:22:10 -08:00
tailwind.config.js chore: nix fmt 2026-01-05 18:22:10 -08:00
website.cabal Initial commit 2026-01-05 16:03:58 -08:00

Hakyll + Typst Static Site Template

A static site generator template using Hakyll with Typst for content authoring. Derived with technology from my own website, but fully generic and stripped down.

Especially suited for websites with a lot of long-form, possibly (but not necessarily) technical text, such as a technical blog, hence its name. Extremely hackable and customizable.

This is not a turnkey, batteries-included template. If you want to use it beyond very simple customizations, you will need familiarity with Haskell, as well as a working understanding of hakyll (skimming the short tutorials should be enough).

Features

  • Typst for content - write pages and blog posts in Typst's modern markup
  • Hakyll for build - Haskell-based static site generator
  • Blaze-html for templates - type-safe HTML generation in Haskell
  • Tailwind CSS for styling - utility-first CSS with dark mode support
  • Automatic feeds - RSS, Atom, and JSON feeds generated from posts

Quick Start

Requires Nix with flakes enabled.

# Build the SSG binary
nix build

# Run hot-reloading dev server (for editing Typst content)
result/bin/website watch

# Preview production build at localhost:8000
nix run

Development

# Enter development shell with all tools
nix develop

# Or use direnv
direnv allow

In the dev shell:

# Rebuild site
cabal run website -- rebuild

# Watch mode (hot reload, at localhost:8000)
cabal run website -- watch

Justfile

A justfile is provided for common tasks. Run just --list to see all commands.

just                     # Sync typst package + rebuild site
just dev                 # Watch mode with hot reload
just sync-typst-package  # Sync html-shim to local Typst cache
just repl                # Start cabal repl
just hoogle              # Run local Hoogle server

Important: Run just sync-typst-package after cloning the repo. This installs the local html-shim Typst package to your cache, which is required for Typst language servers (e.g. tinymist) to provide completions and live preview.

Project Structure

root/           # Top-level pages (*.typ → /*.html)
posts/          # Blog posts (*.typ → /postname/index.html)
src/            # Haskell source for the SSG
  Main.hs       # Hakyll build rules
  Templates.hs  # Blaze-html page templates
  Constants.hs  # Site configuration
css/main.css    # Tailwind CSS source

Configuration

Edit src/Constants.hs to set:

  • siteName - your site's name
  • siteRoot - your site's URL
  • siteDescription - description for feeds
  • Feed author name and email

Adding Content

Pages

Create root/pagename.typ:

---
title: "Page Title"
---

#import "@preview/html-shim:0.1.0": *
#show: html-shim

Your content here.

Blog Posts

Create posts/post-slug.typ:

---
title: Post Title
description: Brief description for feeds
published: 2025-01-01
---

#import "@preview/html-shim:0.1.0": *
#show: html-shim

Post content here.

Checks

# Run all checks (formatting, linting, etc.)
nix build .#checks.x86_64-linux.pre-commit-check

License

GPL-3.0-or-later