No description
Find a file
2026-02-07 19:53:48 -08:00
.github/workflows Add GitHub Actions CI workflow 2026-02-07 19:53:48 -08:00
.zed Update readme, actually render drafts, and add scripts to manage drafts 2025-06-06 12:28:35 -07:00
bin Trim redundant Bake tasks and improve bootstrap 2026-02-07 17:30:43 -08:00
images new favicon 2014-03-02 15:58:36 -08:00
lib Make plugins explicit and improve coverage workflows 2026-02-07 19:50:19 -08:00
posts Normalize post Tags frontmatter format 2026-02-07 18:44:31 -08:00
public Fix internal permalink regression in archives 2026-02-07 18:25:35 -08:00
spec Make plugins explicit and improve coverage workflows 2026-02-07 19:50:19 -08:00
wayback wat? 2014-04-06 22:14:56 -07:00
.gitignore Remove frontmatter conversion tooling 2026-02-07 16:10:56 -08:00
.ruby-version Ruby 4.0.1, update gems, fix lint warnings 2026-02-07 17:56:14 -08:00
AGENTS.md Make plugins explicit and improve coverage workflows 2026-02-07 19:50:19 -08:00
bake.rb Make plugins explicit and improve coverage workflows 2026-02-07 19:50:19 -08:00
Gemfile Migrate test suite from RSpec to Minitest 2026-02-07 18:53:02 -08:00
Gemfile.lock Migrate test suite from RSpec to Minitest 2026-02-07 18:53:02 -08:00
projects.toml Load site and projects from TOML files 2026-02-07 16:20:27 -08:00
Readme.md Make plugins explicit and improve coverage workflows 2026-02-07 19:50:19 -08:00
site.toml Make plugins explicit and improve coverage workflows 2026-02-07 19:50:19 -08:00

samhuri.net

Source code for samhuri.net, powered by a Ruby static site generator.

Overview

This repository is now a single integrated Ruby project. The legacy Swift generators (gensite/ and samhuri.net/) have been removed.

  • Generator core: lib/
  • Build tasks and utility workflows: bake.rb
  • Tests: spec/
  • Config: site.toml and projects.toml
  • Content: posts/ and public/
  • Output: www/

Requirements

  • Ruby (see .ruby-version)
  • Bundler
  • rbenv recommended

Setup

bin/bootstrap

Or manually:

rbenv install -s "$(cat .ruby-version)"
rbenv exec bundle install

Build And Serve

rbenv exec bundle exec bake debug   # build for http://localhost:8000
rbenv exec bundle exec bake serve   # serve www/ locally

Configuration

Site metadata and project data are configured with TOML files at the repository root:

  • site.toml: site identity, default scripts/styles, and a plugins list (for example ["posts", "projects"]), plus projects_plugin assets when that plugin is enabled.
  • projects.toml: project listing entries using [[projects]].

Pressa.create_site loads both files from the provided source_path and still supports URL overrides for debug, beta, and release builds.

Customizing for your site

If this workflow seems like a good fit, here is the minimum to make it your own:

  • Update site.toml with your site identity (author, email, title, description, url) and any global scripts / styles.
  • Set plugins in site.toml to explicitly enable features ("posts", "projects"). Safe default if omitted is no plugins.
  • Define your projects in projects.toml using [[projects]] entries with name, title, description, and url.
  • Configure project-page-only assets in site.toml under [projects_plugin] (scripts and styles) when using the "projects" plugin.
  • Add custom plugins by implementing Pressa::Plugin in lib/ and registering them in lib/config/loader.rb.
  • Adjust rendering and layout in lib/views/ and the static content in public/ as needed.

Other targets:

rbenv exec bundle exec bake mudge
rbenv exec bundle exec bake beta
rbenv exec bundle exec bake release
rbenv exec bundle exec bake watch target=debug
rbenv exec bundle exec bake clean
rbenv exec bundle exec bake publish_beta
rbenv exec bundle exec bake publish

Draft Workflow

rbenv exec bundle exec bake new_draft "Post title"
rbenv exec bundle exec bake drafts
rbenv exec bundle exec bake publish_draft public/drafts/post-title.md

Published posts in posts/YYYY/MM/*.md require YAML front matter keys:

  • Title
  • Author
  • Date
  • Timestamp

Tests And Lint

rbenv exec bundle exec bake test
rbenv exec bundle exec standardrb

Or via bake:

rbenv exec bundle exec bake test
rbenv exec bundle exec bake lint
rbenv exec bundle exec bake lint_fix

Notes

  • bake watch is Linux-only and requires inotifywait.
  • Deployment uses rsync to host mudge (configured in bake.rb):
    • production: /var/www/samhuri.net/public
    • beta: /var/www/beta.samhuri.net/public