Source code for samhuri.net, powered by a Ruby static site generator.
This repository contains the Ruby static-site generator and site content for samhuri.net.
If what you want is an artisanal, hand-crafted, static site generator for your personal blog then this might be a decent starting point. If you want a static site generator for other purposes then this has the bones you need to do that too, by ripping out the bundled plugins for posts and projects and writing your own.
- Generator core:
lib/pressa/(entrypoint:lib/pressa.rb) - Build tasks and utility workflows:
bake.rb - Tests:
test/ - Config:
site.tomlandprojects.toml - Content:
posts/andpublic/ - Output:
www/(HTML),gemini/(Gemini capsule)
- Ruby (see
.ruby-version) - Bundler
rbenvrecommended
bin/bootstrapOr manually:
rbenv install -s "$(cat .ruby-version)"
bundle installbake debug # build for http://localhost:8000
bake serve # serve www/ locallySite metadata and project data are configured with TOML files at the repository root:
site.toml: site identity, default scripts/styles, apluginslist (for example["posts", "projects"]), and output-specific settings underoutputs.*(for exampleoutputs.html.remote_linksandoutputs.gemini.{exclude_public,recent_posts_limit,home_links}), plusprojects_pluginassets when that plugin is enabled.projects.toml: project listing entries using[[projects]].
Pressa.create_site loads both files from the provided source_path and supports URL overrides for debug, beta, and release builds.
If this workflow seems like a good fit, here is the minimum to make it your own:
- Update
site.tomlwith your site identity (author,email,title,description,url) and any globalscripts/styles. - Set
pluginsinsite.tomlto explicitly enable features ("posts","projects"). Safe default if omitted is no plugins. - Define your projects in
projects.tomlusing[[projects]]entries withname,title,description, andurl. - Configure project-page-only assets in
site.tomlunder[projects_plugin](scriptsandstyles) when using the"projects"plugin. - Configure output pipelines with
site.tomloutputs.*tables:[outputs.html]supportsremote_links(array of{label, href, icon}).[outputs.gemini]supportsexclude_public,recent_posts_limit, andhome_links(array of{label, href}).
- Add custom plugins by implementing
Pressa::Plugininlib/pressa/and registering them inlib/pressa/config/loader.rb. - Adjust rendering and layout in
lib/pressa/views/and the static content inpublic/as needed.
Other targets:
bake mudge
bake beta
bake release
bake gemini
bake watch target=debug
bake clean
bake publish_beta
bake publish_gemini
bake publishbake new_draft "Post title"
bake drafts
bake publish_draft public/drafts/post-title.mdPublished posts in posts/YYYY/MM/*.md require YAML front matter keys:
TitleAuthorDateTimestamp
bake test
standardrbOr via bake:
bake test
bake lint
bake lint_fixbake watchis Linux-only and requiresinotifywait.- Deployment uses
rsyncto hostmudge(configured inbake.rb):- production:
/var/www/samhuri.net/public - beta:
/var/www/beta.samhuri.net/public - gemini:
/var/gemini/samhuri.net
- production: