content-genesis

generate interpolated content from template files

Usage no npm install needed!

<script type="module">
  import contentGenesis from 'https://cdn.skypack.dev/content-genesis';
</script>

README

logo

Build Status

Install

yarn add content-genesis

Use

const { template } = require("content-genesis");
let foo = { variable1: "Foo", variable2: "Bar" };
let fooTemplate = template("/path/to/template", foo);
  • See test for more detailed code.

How it works

  1. You define a template ( like this example )
  2. Next, you define the variables which will be interpolated eg. let foo = {component: "Foo"}
  3. You call template(/template/path, variablesObject)

Related