{"id":17331873,"url":"https://github.com/ocramz/twelve","last_synced_at":"2025-09-21T06:52:33.197Z","repository":{"id":66327836,"uuid":"319951827","full_name":"ocramz/twelve","owner":"ocramz","description":"Like @11ty , but this goes up to 12","archived":false,"fork":false,"pushed_at":"2021-01-26T20:04:40.000Z","size":72,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-21T18:24:26.714Z","etag":null,"topics":["html-parser","html-template-engine","html-templating","static-site-generator","static-website-generation","template-engine"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocramz.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}},"created_at":"2020-12-09T12:36:48.000Z","updated_at":"2021-01-26T19:54:06.000Z","dependencies_parsed_at":"2023-03-09T09:15:55.824Z","dependency_job_id":null,"html_url":"https://github.com/ocramz/twelve","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ocramz/twelve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocramz%2Ftwelve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocramz%2Ftwelve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocramz%2Ftwelve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocramz%2Ftwelve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocramz","download_url":"https://codeload.github.com/ocramz/twelve/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocramz%2Ftwelve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276204838,"owners_count":25602738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["html-parser","html-template-engine","html-templating","static-site-generator","static-website-generation","template-engine"],"created_at":"2024-10-15T14:55:53.825Z","updated_at":"2025-09-21T06:52:33.180Z","avatar_url":"https://github.com/ocramz.png","language":"Haskell","readme":"# twelve\n\n![CI](https://github.com/ocramz/twelve/workflows/Haskell%20CI/badge.svg)\n\nLike [11ty](https://www.11ty.dev/), but this goes to 12.\n\n## What\n\n`twelve` is a small and simple static site generator, inspired by 11ty.\n\n\n\n\n## Why\n\n`twelve` was created to achieve these goals :\n\n* Modularity\n\n* Ease of use\n\n## Why, in detail\n\nThe main rationale for this project, and its claim to enabling a modular approach in website construction, is the following :\n\n`twelve` flips the templating logic of 11ty on its head : it lets you reference directly a content splice from within a container template, rather than declaring the name of a layout file from within the file containing the content splice.\n\nFor example, say we want to splice the content of `card1.html` into some list items within `base.html` :\n\n```html\n\u003c!-- base.html --\u003e\n\u003chtml\u003e\n    \u003cbody\u003e\n        \u003cul\u003e\n            \u003cli\u003e {{ card1.html }} \u003c/li\u003e\n            \u003cli\u003e {{ card1.html }} \u003c/li\u003e\n        \u003c/ul\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n```html\n\u003c!-- card1.html --\u003e\n\u003cdiv\u003eHello from card 1 ! \u003c/div\u003e\n```\n\nLet's try building `base.html` and look at the result :\n\n```\n$ twelve build -f base.html\n```\n\n```\n$ cat _site/base.html\n```\n\n```html\n\u003chtml\u003e\n    \u003cbody\u003e\n        \u003cul\u003e\n            \u003cli\u003e\n                \u003cdiv\u003e\n                    Hello from card 1 !\n                \u003c/div\u003e\n            \u003c/li\u003e\n            \u003cli\u003e\n                \u003cdiv\u003e\n                    Hello from card 1 !\n                \u003c/div\u003e\n            \u003c/li\u003e\n        \u003c/ul\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\nThis means that you can develop webpage sections in isolation (e.g. navbar, hero sections etc.), and easily reuse them in multiple places within `base` or other files that mention them. \n\n### Note\n\n* Template files should be valid HTML splices, i.e. cannot be bare text.\n\n* All input files and templates should have an `.html` file extension.\n\n* Template files can reference other ones up to an arbitrary depth, as long as the reference graph is acyclic. If you do have two templates that reference each other, well, you're asking for trouble.\n\n## Why, in full\n\nModern websites tend to accrete large amounts of CSS annotations around their HTML tags, and a module system can help in writing easily maintainable websites from reasonably-sized components.\n\nIn addition, many website build tools and templating languages try to do too much or to impose many design constraints upon the user. `twelve` aims to help without getting in the way.\n\n## Installation\n\nFirst, you need to have the [`stack` build tool](https://haskellstack.org) already set up on your machine.\n\nThen, build and copy the `twelve` binary to a local `bin` directory with\n\n    $ stack install\n    \nYou can see where the tool will be installed with \n\n    $ stack path --local-bin\n    \nPlease refer to the `stack` manual for details.\n    \n## Usage\n\n```\n$ twelve\ntwelve, a little static website build tool\n\nUsage: twelve COMMAND\n  twelve lets you build an HTML page from a collection of templates. Please\n  refer to the README for details. github.com/ocramz/twelve\n\nAvailable options:\n  -h,--help                Show this help text\n\nAvailable commands:\n  init                     Initialize a 'twelve' project\n  build                    Build an HTML page\n```\n\n`twelve` has two commands: \n\n* `init` initializes a project in the current directory, if there isn't one already (i.e. it creates a config file and the input and output directories using the command line options `-i` and `-o`). The input directory contains the HTML templates that will be used for populating the final result.\n\nThe default directories can be overridden with command line parameters.\n\n* `build` does the whole work : produces a full HTML file by starting from a given input template file and splicing in the content of all references:\n\n```\n$ twelve build\nUsage: twelve build [[-i|--dir-in DIR] [-o|--dir-out DIR]] -f FILEPATH\n  Build an HTML page\n\nAvailable options:\n  -i,--dir-in DIR          input directory for HTML\n                           templates (default: \"_templates\")\n  -o,--dir-out DIR         output directory (default: \"_site\")\n  -f FILEPATH              path of input file\n```\n\nBy default `build` will try to use the `twelve.json` config file. If that's not found, `twelve` will use the command line defaults, which can also be overridden here.\n\n    \n## Contribute\n\nThe aim of this project is to be simple and straightforward to use; PRs welcome ! \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focramz%2Ftwelve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focramz%2Ftwelve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focramz%2Ftwelve/lists"}