A bespoke build system for static websites
  • Go 95.7%
  • Dockerfile 4.3%
Find a file
Max R. 0481ba1014
All checks were successful
Build and Push Image / build-and-push (push) Successful in 30s
generator: use os.Create instead of os.OpenFile
2026-07-04 19:54:05 -07:00
.forgejo/workflows support for scss and ts, new dockerfile 2026-06-07 20:54:02 -07:00
internal generator: use os.Create instead of os.OpenFile 2026-07-04 19:54:05 -07:00
license update repository stuff [skip ci] 2026-06-07 21:30:49 -07:00
resources get tool to a pretty good state 2026-06-06 21:46:07 -07:00
testdata support for scss and ts, new dockerfile 2026-06-07 20:54:02 -07:00
.gitignore get tool to a pretty good state 2026-06-06 21:46:07 -07:00
Dockerfile support for scss and ts, new dockerfile 2026-06-07 20:54:02 -07:00
go.mod add main launcher, tidy modules 2026-05-21 14:57:43 -07:00
go.sum add main launcher, tidy modules 2026-05-21 14:57:43 -07:00
imports.go support for scss and ts, new dockerfile 2026-06-07 20:54:02 -07:00
main.go fuckkkkkk dudeeeeeee 2026-07-01 14:02:59 -07:00
README.md fix typo [skip ci] 2026-06-07 21:39:36 -07:00

Background Radiation

Background Radiation, or BakRad, or br is a bespoke build system for static sites. I use it to automate deployment of the various static sites I run with Caddy.

Given a git-compatible URL for a site repository, the tool will clone or pull the latest commit and process files. Processing files is simply a matter of copying desired files to a pre-defined production directory. By default only files matching the following patterns are processed:

  • static/**/*
  • templates/**/*
  • *.html

A site may wish to deploy a number of different files to production, this is possible with the inclusion of a .bakrad_include file at the root of the repository. The handling of the file is naive, if a line starts with a # it is treated as a comment. Otherwise, a line is assumed to be a glob pattern & will be used to match files in the cloned repository directory.

Dependencies

bakrad has two major dependencies, sass and tsc. They need to be installed and in the tool's $PATH to work. This document does not go into detail on installing them, but it does provide a Docker image with each tool installed already. Please see the following:

$ # use the paths you define in your config file for host-side mounts
$ docker run \
    --rm \
    -v /etc/bakrad:/etc/bakrad \
    -v /srv/www:/srv/www \
    -v /var/lib/bakrad:/var/lib/bakrad \
    bakrad

Config

bakrad uses TOML for its configuration. By default, it will attempt to load /etc/bakrad/config.toml. This behavior can be changed using a flag described below. The following is an example configuration file:

data_root = "/var/lib/bakrad" # path to where bakrad should store data
production_root = "/srv/www" # path to where production sites live

[[sites]] # an array of sites
name = "beer4kids.blog"
git_url = "https://slapshit.net/max/beer4kids.blog"

Docker

License

bakrad uses code sourced from the Go standard library. Please see the license.

Otherwise, code is licensed under the MIT license.