{"id":13630661,"url":"https://github.com/c8r/gen","last_synced_at":"2025-04-12T00:55:13.896Z","repository":{"id":95427416,"uuid":"113580356","full_name":"c8r/gen","owner":"c8r","description":"Compositor JSX static site generator","archived":false,"fork":false,"pushed_at":"2018-04-01T20:10:19.000Z","size":61,"stargazers_count":97,"open_issues_count":4,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T00:55:01.981Z","etag":null,"topics":["compositor","iso","jsx","lab","react","static-site-generator"],"latest_commit_sha":null,"homepage":"https://compositor.io/","language":"JavaScript","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/c8r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-12-08T14:00:30.000Z","updated_at":"2025-01-06T02:59:44.000Z","dependencies_parsed_at":"2023-08-30T02:09:39.730Z","dependency_job_id":null,"html_url":"https://github.com/c8r/gen","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Fgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Fgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Fgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c8r%2Fgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c8r","download_url":"https://codeload.github.com/c8r/gen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501880,"owners_count":21114683,"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":["compositor","iso","jsx","lab","react","static-site-generator"],"created_at":"2024-08-01T22:01:53.103Z","updated_at":"2025-04-12T00:55:13.875Z","avatar_url":"https://github.com/c8r.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# Gen\n\nCompositor JSX static site generator\n\n```sh\nnpm i @compositor/gen -g\n```\n\n- Build static sites with [Lab][lab] components and [Iso][iso] JSX files\n- Exports static HTML and inlined CSS\n- Handles multiple routes\n- Export CSS using styled-components, glamorous, and more\n- Use Lab components and themes in markdown\n- Pass props data via front-matter\n\n## Usage\n\nExport a static site:\n\n```sh\ngen . --out-dir dist\n```\n\nRun in development mode:\n\n```sh\ngen . --dev\n```\n\n### How it works\n\nGiven a folder structure like the following:\n\n```\ndist/\nsrc/\n  about.jsx\n  index.jsx\n  lab.json\n  theme.json\n```\n\nRunning `gen src --out-dir dist` will create HTML files:\n\n```\ndist/\n  about/\n    index.html\n  index.html\n```\n\n### Files\n\nGen will load `theme.json` and `lab.json` files in the target directory and import Lab components.\nAny files ending with `.jsx` or `.md` will be used to create pages.\nMarkdown and JSX files can include [front-matter][front-matter] for setting page-level attributes,\nsuch as title and description, and also be passed to the page component as props.\n\n**Example JSX file**\n\n```jsx\n---\ntitle: Hello World\ndescription: This is a demo page\n---\n\u003cBox px={3} py={4}\u003e\n  \u003cHeading\u003e{props.title}\u003c/Heading\u003e\n\u003c/Box\u003e\n\u003cCustomLabComponent\n  description={props.description}\n/\u003e\n```\n\n### Front Matter Options\n\nAll front matter is passed to the JSX file as a `props` object.\nAdditionally, page-level metadata can be set using the following properties:\n\n- `title` page title\n- `description` page description\n- `og` object of open graph data\n- `twitter` object of Twitter card data\n- `stylesheets` array of stylesheet URLs to add as links in the head\n- `scripts` array of JavaScript strings to include before the closing body tag\n\n### Layouts\n\nWhen rendering markdown files, Gen will look for a `layout` property in front-matter. If a JSX file with the same name is found, it will be used as a page layout component, passing the rendered markdown content as children.\n\n**Example markdown file**\n\n```md\n---\ntitle: About\nlayout: default-layout\n---\n\n# About\n```\n\n**Example JSX layout file**\n\n```jsx\n---\n---\n\u003cSiteHeader /\u003e\n\u003cBox px={3} py={4}\u003e\n  {props.children}\n\u003c/Box\u003e\n\u003cSiteFooter /\u003e\n```\n\n### CLI options\n\n- `--out-dir`, `-d`: output directory\n- `--dev`, `-D`: run as development server\n- `--open`, `-o`: open development server in default browser\n- `--port`, `-p`: set port for development server\n\n---\n\n[Made by Compositor](https://compositor.io/)\n|\n[MIT License](LICENSE.md)\n\n[lab]: https://compositor.io/lab/\n[iso]: https://compositor.io/iso/\n[front-matter]: https://jekyllrb.com/docs/frontmatter/\n[open-formats]: https://compositor.io/blog/open-formats/\n\n\u003c!--\n- gen.config.js (get data)\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc8r%2Fgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc8r%2Fgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc8r%2Fgen/lists"}