Skip to content
Alex edited this page Jul 18, 2022 · 3 revisions

HTMLC Reference

Terminology

A Template includes partials & or data A Partial includes data (soon will be able to nest partials in themselves too)

A Chunk is either a template or a partial, and a Page is the compiled result of these 3 concepts.

html-chunk-loader (htmlc) is a simple, lightweight template engine for Node. It has support for ssr/ssg depending on what your goal is.

Install CLI

npm i -g html-chunk-loader
yarn global add html-chunk-loader

cli quickstart

html-chunk-loader quickstart

creates demo project in current directory, ready to be compiled

command line compiler

html-chunk-loader ssg

builds html files into the public directory

Install Project SSR Engine

npm i html-chunk-loader
yarn add html-chunk-loader

Import Paths

CommonJS

const { useLoader } = require('html-chunk-loader');

Typescript / ES6+

import { useLoader } from 'html-chunk-loader';