Skip to content

businessfunk/ypsilanti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ypsilanti

minimal static site generator in zig.

install

requires zig (0.14+).

zig build -Doptimize=ReleaseFast
cp zig-out/bin/ypsilanti /usr/local/bin/

-Doptimize options: Debug (default), ReleaseSafe, ReleaseFast, ReleaseSmall. use ReleaseFast for production, skip the flag for development.

usage

ypsilanti build ./site ./output    # build site
ypsilanti serve ./site             # dev server on :3000
ypsilanti serve ./site 8080        # custom port

site structure

site/
├── content/     # markdown files → html
├── layouts/     # page templates
├── partials/    # reusable snippets
├── static/      # copied as-is (css, images, fonts)
└── url          # optional: base url for rss/sitemap

front matter

---
title: Hello World
date: 2025-01-09
description: post summary for rss
layout: post
---

your content here
  • title - page title, available as {{title}}
  • date - includes page in rss feed
  • description - rss item description
  • layout - which layout to use from layouts/

any key is available as {{key}} in templates.

templates

layouts go in layouts/. use {{content}} for the rendered markdown:

<!DOCTYPE html>
<html>
<head><title>{{title}}</title></head>
<body>
  {{> header}}
  <main>{{content}}</main>
</body>
</html>

partials go in partials/. include with {{> name}}:

<!-- partials/header.html -->
<nav><a href="/">home</a></nav>

markdown

supported:

  • # headers (h1-h6)
  • **bold** and *italic*
  • [links](url)
  • `inline code`
  • fenced code blocks with language class
  • - unordered lists
  • > blockquotes

error pages

create content/404.md for custom 404 pages. works in dev server and most static hosts.

rss + sitemap

auto-generated on build:

  • sitemap.xml - all pages
  • feed.xml - pages with date: front matter

set base url in site/url:

https://example.com

github pages

build to docs/ and enable pages from that folder:

ypsilanti build ./site ./docs
git add docs && git commit -m "build" && git push

or use github actions - see repo for example workflow.

dev workflow

ypsilanti serve ./site

opens dev server with live reload. edit any file in content/, layouts/, partials/, or static/ and browser refreshes automatically.

tests

./test.sh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages