All Projects → c8r → Gen

c8r / Gen

Licence: mit
Compositor JSX static site generator

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gen

X0
Document & develop React components without breaking a sweat
Stars: ✭ 1,706 (+1695.79%)
Mutual labels:  static-site-generator, compositor, jsx
lab-cli
Command line utilities and exporting module for Compositor Lab
Stars: ✭ 52 (-45.26%)
Mutual labels:  lab, compositor
fledermaus
Batman’s toolbelt for static site generation
Stars: ✭ 77 (-18.95%)
Mutual labels:  static-site-generator, jsx
gatsby-reactstrap
Adding Bootstrap 4 to an Gatsby React App and serve generated the static site with Express.js
Stars: ✭ 25 (-73.68%)
Mutual labels:  static-site-generator, jsx
11tyby
Simple 11ty setup using TypeScript, SASS, Preact with partial hydration, and other useful things. Aims to provide the DX of Gatsby, but using 11ty!
Stars: ✭ 38 (-60%)
Mutual labels:  static-site-generator, jsx
Libqpsd
PSD (Photoshop Document) & PSB (Photoshop Big) Plugin for Qt/C++ (Qt4/Qt5)
Stars: ✭ 90 (-5.26%)
Mutual labels:  lab
Stencil
A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
Stars: ✭ 9,880 (+10300%)
Mutual labels:  static-site-generator
Sax Wasm
The first streamable, fixed memory XML, HTML, and JSX parser for WebAssembly.
Stars: ✭ 89 (-6.32%)
Mutual labels:  jsx
Nextra
The Next.js Static Site Generator
Stars: ✭ 1,271 (+1237.89%)
Mutual labels:  static-site-generator
Still
A composable Elixir static site generator
Stars: ✭ 96 (+1.05%)
Mutual labels:  static-site-generator
Babel Plugin Jsx Adopt
Stars: ✭ 94 (-1.05%)
Mutual labels:  jsx
Metalsmith React Templates
A metalsmith plugin to render files using React / Preact / JSX based templates.
Stars: ✭ 90 (-5.26%)
Mutual labels:  static-site-generator
Deeplearning2020
course materials for introduction to deep learning 2020
Stars: ✭ 90 (-5.26%)
Mutual labels:  lab
Babel Plugin React Persist
Automatically useCallback() & useMemo(); memoize inline functions
Stars: ✭ 91 (-4.21%)
Mutual labels:  jsx
Jsx Ast Utils
AST utility module for statically analyzing JSX
Stars: ✭ 89 (-6.32%)
Mutual labels:  jsx
Pelican Blue
Responsive theme for Pelican Static Site Generator, Powered by Python
Stars: ✭ 94 (-1.05%)
Mutual labels:  static-site-generator
Gatsby Theme Try Ghost
A Gatsby theme to build flaring fast blogs from headless Ghost CMS
Stars: ✭ 88 (-7.37%)
Mutual labels:  static-site-generator
Testing Hapi
Hapi style guide compliant boilerplate (updated to v17!)
Stars: ✭ 90 (-5.26%)
Mutual labels:  lab
Kindd
A kindful dd, written in qt-quick.
Stars: ✭ 93 (-2.11%)
Mutual labels:  iso
React Atomic Structure
Basic Structure for React app following Atomic Design
Stars: ✭ 89 (-6.32%)
Mutual labels:  jsx

Gen

Compositor JSX static site generator

npm i @compositor/gen -g
  • Build static sites with Lab components and Iso JSX files
  • Exports static HTML and inlined CSS
  • Handles multiple routes
  • Export CSS using styled-components, glamorous, and more
  • Use Lab components and themes in markdown
  • Pass props data via front-matter

Usage

Export a static site:

gen . --out-dir dist

Run in development mode:

gen . --dev

How it works

Given a folder structure like the following:

dist/
src/
  about.jsx
  index.jsx
  lab.json
  theme.json

Running gen src --out-dir dist will create HTML files:

dist/
  about/
    index.html
  index.html

Files

Gen will load theme.json and lab.json files in the target directory and import Lab components. Any files ending with .jsx or .md will be used to create pages. Markdown and JSX files can include front-matter for setting page-level attributes, such as title and description, and also be passed to the page component as props.

Example JSX file

---
title: Hello World
description: This is a demo page
---
<Box px={3} py={4}>
  <Heading>{props.title}</Heading>
</Box>
<CustomLabComponent
  description={props.description}
/>

Front Matter Options

All front matter is passed to the JSX file as a props object. Additionally, page-level metadata can be set using the following properties:

  • title page title
  • description page description
  • og object of open graph data
  • twitter object of Twitter card data
  • stylesheets array of stylesheet URLs to add as links in the head
  • scripts array of JavaScript strings to include before the closing body tag

Layouts

When 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.

Example markdown file

---
title: About
layout: default-layout
---

# About

Example JSX layout file

---
---
<SiteHeader />
<Box px={3} py={4}>
  {props.children}
</Box>
<SiteFooter />

CLI options

  • --out-dir, -d: output directory
  • --dev, -D: run as development server
  • --open, -o: open development server in default browser
  • --port, -p: set port for development server

Made by Compositor | MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].