coralite
v0.27.0
Published
HTML modules static site generator
Maintainers
Readme
Coralite
coralite is a static site generator library built around the emerging HTML modules proposal.
- Getting started
- Reference
- Coralite CLI
- Coralite
- Plugin system
- Create plugin
- The
createPluginfunction is the entry point for extending Coralite's functionality.
- The
- Define component
- The
defineComponentplugin is Coralite's core built-in plugin that enables dynamic template functionality.
- The
- Ref
- The
refsplugin is a built-in Coralite helper that provides runtime DOM element access.
- The
- Metadata
- The
metadataplugin is a built-in Coralite tool that extracts metadata from tags in your page's and makes them available as template variables.
- The
- Create plugin
- Types
Installation
Before using the Coralite CLI, ensure that it's installed on your system. You can install it globally using npm:
npm install -g coralite
# or
yarn global add coralite
# or
pnpm add -g coraliteYou can also install coralite as a development dependency:
npm install --save-dev coralite
# or
yarn add -D coralite
# or
pnpm add -D coraliteBasic Syntax
Coralite is executed using the following command:
coralite [options]For more information about the
Replace [options] with the desired flags and arguments.
Required Options
To generate a website using Coralite, you must provide three essential options:
- -t or --templates: The path to your templates directory containing reusable UI elements (e.g.,
-t src/templates). - -p or --pages: The path to your pages directory where static HTML files reside (e.g.,
-p src/pages). - --output or -o: The output directory for the generated site (e.g.,
--output dist).
Here's an example of how these options might look:
coralite --templates path/to/templates --pages path/to/pages --output distOptional Options
-d or --dry-run
Run the CLI in dry-run mode to preview the actions that would be performed without actually generating the website. This is useful for debugging or when you want to check potential issues before committing changes:
coralite --templates path/to/templates --pages path/to/pages --output dist --dry-run