{"id":49669048,"url":"https://github.com/jaredkrinke/luasmith","last_synced_at":"2026-05-23T09:01:10.727Z","repository":{"id":289027153,"uuid":"969880192","full_name":"jaredkrinke/luasmith","owner":"jaredkrinke","description":"Tiny (~450 KB) static site generator that's like Metalsmith in Lua","archived":false,"fork":false,"pushed_at":"2026-04-13T22:22:09.000Z","size":187,"stargazers_count":76,"open_issues_count":22,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-14T00:29:01.989Z","etag":null,"topics":["etlua","link-checker","lua","markdown","minimal","ssg","static-site-generator","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://log.schemescape.com/posts/static-site-generators/smallest-static-site-generator.html","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaredkrinke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-21T04:58:21.000Z","updated_at":"2026-04-13T22:22:06.000Z","dependencies_parsed_at":"2025-04-21T06:26:59.606Z","dependency_job_id":"3d6cbb94-2f31-4aa6-b26e-832b964ac5ef","html_url":"https://github.com/jaredkrinke/luasmith","commit_stats":null,"previous_names":["jaredkrinke/luasmith"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jaredkrinke/luasmith","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fluasmith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fluasmith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fluasmith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fluasmith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredkrinke","download_url":"https://codeload.github.com/jaredkrinke/luasmith/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredkrinke%2Fluasmith/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33389229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["etlua","link-checker","lua","markdown","minimal","ssg","static-site-generator","syntax-highlighting"],"created_at":"2026-05-06T19:00:34.033Z","updated_at":"2026-05-23T09:01:10.713Z","avatar_url":"https://github.com/jaredkrinke.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# luasmith\n**luasmith** is a small, simple, and flexible [static site generator](https://en.wikipedia.org/wiki/Static_site_generator) that is similar in design to [Metalsmith](https://metalsmith.io/), but much smaller because it's built on top of [Lua](https://www.lua.org/) and C instead of JavaScript and Node.js. Example sites are: [here](https://log.schemescape.com/) and [here](https://jaredkrinke.github.io/til/).\n\n## Features\n* Seamless relative links between Markdown files\n* Link checking\n* Syntax highlighting\n* Zero run-time dependencies (and \u003c 500 KB!)\n\n## Show me the code!\nSee [the tutorial](docs/tutorial.md) for more, but here's an example that converts Markdown to HTML and adds the page's title to the resulting HTML:\n\n```lua\n-- Minimal HTML template (used below)\nlocal outer = [[\n\u003chtml\u003e\n  \u003chead\u003e\u003ctitle\u003e\u003c%= title %\u003e\u003c/title\u003e\u003c/head\u003e\n  \u003cbody\u003e\u003c%- content %\u003e\u003c/body\u003e\n\u003c/html\u003e\n]]\n\n-- Read content/*.md, convert to HTML,\n-- apply template, write to out/*.html\nreturn {\n  readFromSource(\"content\"),\n  processMarkdown(),\n  highlightSyntax(),\n  applyTemplates({ { \"%.html$\", outer } }),\n  checkLinks(),\n  writeToDestination(\"out\"),\n}\n```\n\n## Summary\nMost of the heavy lifting in luasmith is done by [md4c](https://github.com/mity/md4c) ([patched](https://github.com/jaredkrinke/md4c/commit/fc4cac5277b060450d93b06a67397388defa358d) for relative links), [Lua](https://www.lua.org/), [etlua](https://github.com/leafo/etlua), and [Scintillua](https://github.com/orbitalquark/scintillua).\n\nTo get a feel for luasmith, either [read over the design](#architecture) or [go through the tutorial](docs/tutorial.md).\n\nNote that luasmith is still an experimental project, subject to breaking changes. If you like *the idea* of luasmith, let me know and I can put some work into stabilizing and polishing it--for now, I'm assuming I'm probably the only person writing plugins.\n\n### Supported platforms\nThere are multiple builds of luasmith available from [the releases page](https://github.com/jaredkrinke/luasmith/releases):\n\n* Statically-linked, native **Linux** build: `luasmith-*-linux-x86_64.tar.gz`\n* **Windows** build: `luasmith-*-windows-x86_64.zip`\n* \"Actually Portable Executable\" build (using [Cosmopolitan](https://github.com/jart/cosmopolitan)) that should run on **Windows**, **macOS**, **Linux**, and most **BSDs**: `luasmith-*-universal.zip`\n* There's also a source archive that actually includes submodule code (unlike GitHub's automatic source archives)\n\n## Quickstart\nTo create a minimal blog:\n\n1. Download binary package or clone and compile with `make`\n2. Create an input directory named `content/`\n3. Add `site.lua` returning a table containing `title` (site title) and `url` (root URL for the site--used for RSS)\n4. Add Markdown files (with `title`, `description`,  and `date` in frontmatter)\n5. Run `./luasmith blog` (this will read from `content/` and output to `out/`)\n6. Open `out/index.html` to view the site\n7. Optionally, upload it somewhere!\n\nFor step 3, this Lua snippet can be used for a `site.lua` file:\n\n```lua\nreturn {\n  title = \"a website\",\n  url = \"https://a.site/\",\n}\n```\n\nFor step 4, use this Markdown file as a template (it uses YAML frontmatter):\n\n```md\n---\ntitle: Title of the post\ndescription: Short description of the post (for the Atom feed).\ndate: 2025-04-22\n---\nContent goes here. Note you can [link to other posts](foobar.md).\n\n## Subheading\nMore content goes here.\n```\n\n## Themes\nBuilt in themes:\n\n* `blog`: a minimal blog theme ([example site](https://jaredkrinke.github.io/til/))\n* `md2blog`: an opinionated (and slightly less minimal) blog theme, following the structure of [md2blog](https://jaredkrinke.github.io/md2blog/) ([example site](https://log.schemescape.com/))\n\nCommunity themes:\n\n* [`catala`](https://github.com/alunya-cat/luasmith-catala): A theme designed to prioritize readability and content. \n\n## Architecture\nluasmith is designed around the concept of a \"theme\", which is basically a processing pipeline, probably including some templates (and perhaps static assets). You run the tool by providing either the path to a Lua script or the name of a built-in theme:\n\n```\n./luasmith theme.lua\n```\n\nFor a built-in theme you only supply a name (the actual scripts themselves are embedded into the binary, but are present in the `themes` directory of this repository):\n\n```\n./luasmith blog\n```\n\n### Under the Hood\nAfter pointing it to a theme, it's completely up to the theme what happens next, but all built-in themes do the following:\n\n1. Enumerate files in the input directory (named `content/` by default)\n2. Process Markdown (and frontmatter) for `*.md` files\n3. Create a root page (and possibly keyword index pages too)\n4. Apply templates (using [etlua](https://github.com/leafo/etlua))\n5. Write everything to the output directory (named `out/` by default)\n\nNote that the built-in templates assume Markdown files contain metadata in frontmatter that includes `title`, `description`, `date`, and optionally `keywords`. See the `example/content/` directory for examples (using both Lua and a subset of YAML).\n\n### Customization\nIf you want to customize the site's appearance or functionality, just copy an existing theme directory from this repository and start modifying the templates and/or Lua script.\n\n## Example / Tutorial\nSee [docs/tutorial.md](docs/tutorial.md) for a tutorial that starts from scratch with a trivial pipeline and builds it up into a simple blog theme.\n\n## API Documentation\nSee [docs/api.md](docs/api.md) for detailed information on helper functions, processing nodes, etc.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredkrinke%2Fluasmith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredkrinke%2Fluasmith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredkrinke%2Fluasmith/lists"}