{"id":17993154,"url":"https://github.com/leostera/cactus","last_synced_at":"2025-06-12T07:37:12.969Z","repository":{"id":141534816,"uuid":"161850936","full_name":"leostera/cactus","owner":"leostera","description":"🌵A composable static site generator","archived":false,"fork":false,"pushed_at":"2020-07-26T11:29:17.000Z","size":189,"stargazers_count":66,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T01:12:22.794Z","etag":null,"topics":["blazingly-fast","build-system","composable-infrastructure","desert","markdown","ocaml","reasonml","static-site-generator"],"latest_commit_sha":null,"homepage":"","language":"Reason","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leostera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-12-14T23:26:08.000Z","updated_at":"2024-10-01T23:13:52.000Z","dependencies_parsed_at":"2023-08-19T06:45:26.153Z","dependency_job_id":null,"html_url":"https://github.com/leostera/cactus","commit_stats":null,"previous_names":["leostera/cactus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leostera%2Fcactus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leostera%2Fcactus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leostera%2Fcactus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leostera%2Fcactus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leostera","download_url":"https://codeload.github.com/leostera/cactus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245571882,"owners_count":20637416,"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","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":["blazingly-fast","build-system","composable-infrastructure","desert","markdown","ocaml","reasonml","static-site-generator"],"created_at":"2024-10-29T20:10:27.259Z","updated_at":"2025-03-26T01:31:47.492Z","avatar_url":"https://github.com/leostera.png","language":"Reason","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌵 Cactus — A composable static site generator\n\nCactus is a reaction to the amount of static site generators out there\nthat enforce their structures on you. Cactus does very little. If you open it\nup, you'll find it's full of water.\n\n### Installing\n\n`cactus` builds with Esy just fine. Make sure to have `libev-dev` installed tho!\n\n```sh\nesy\nesy build\nesy x cactus\n```\n\n## Getting Started\n\nCactus works in a very simple way. In fact it's almost silly how simple it is.\nIf you put a `cactus-project` file on the root of your project, cactus will look\nthroughout your whole project for `site` files.\n\n`site` files simply tell `cactus` that this particular folder should be compiled\ninto a website.\n\nSo if you have your posts in the following structure:\n\n```sh\nmy/website λ tree\n.\n├── pages\n│   ├── First-post.md\n│   └── Some-other-post.md\n└── sections\n    ├── about.md\n    ├── hire-me.md\n    └── projects.md\n```\n\nYou just need to `touch` a few files:\n\n```sh\nmy/website λ touch cactus-project\nmy/website λ touch pages/site sections/site\n```\n\nAnd you can run `cactus` to compile the website using the same tree structure\nunder a `_public` folder:\n\n```sh\nmy/website λ cactus build\n🌵 Compiling project...\n🌮 Done in 0.002s\n\nmy/website  λ tree\n.\n├── _public\n│   ├── pages\n│   │   ├── First-post.html\n│   │   └── Some-other-post.html\n│   └── sections\n│       ├── about.html\n│       ├── hire-me.html\n│       └── projects.html\n├── cactus-project\n├── pages\n│   ├── First-post.md\n│   ├── Some-other-post.md\n│   └── site\n└── sections\n    ├── about.md\n    ├── hire-me.md\n    ├── projects.md\n    └── site\n```\n\nWhich you can readily serve however you feel like. Upload to S3, Now, GCS,\nGithub pages, or pretty much wherever.\n\nWhen in doubt, check out the `example` folder. All of the features will be\nshowcased there.\n\n### Templating\n\nYou'll quickly notice that the bare compilation from Markdown to HTML doesn't\nquite fit all use-cases. To alleviate this `cactus` lets you specify in your\n`site` file a template file to be used for all the Markdown files within that\nspecific site.\n\nSay you wanted to wrap all of the pages from the example above in a common\nmarkup: add a `\u003cmeta charset=\"utf-8\"\u003e` to all of them. You'd write a template\nfile:\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    {| document |}\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nAnd in your `site` file you'd point to it:\n\n```lisp\n(template \"path/to/template.html\")\n```\n\nVoila! That's all it takes to get the templating up and running. It's very basic\nat the moment, but it'll get you quite far! The next step is to provide better\nsupport for building pages with arbitrary logic, possibly by letting you specify\na module to be used for processing each file.\n\n### Assets\n\nTo copy assets (any supporting file to your site) you can use the `(assets\n...)` rule:\n\n```lisp\n(assets\n  style.css\n  logo.svg\n  bg_music.midi)\n```\n\nAnd they will be automatically copied from their location, relative to the\n`site` file.\n\nYou can also use the shorthand `.` instead of listing your assets to have all\nthe files in the folder copied over. This is not recursive.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleostera%2Fcactus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleostera%2Fcactus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleostera%2Fcactus/lists"}