0.5.2 • Published 6 months ago

statigen v0.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

statigen

A static site generator with built-in support for ejs templates and markdown-to-html transformations.

NOTE: This is still a work in progress, but please feel free to open github issues with any problems you encounter.

Installation

npm install statigen

Usage

#generate using the default `src` and `dist` folders
npx statigen

#generate using custom source and out directories
npx statigen --sourceDir source --outDir docs

Init

You can create a new project by running the init command. This will create a new directory and copy the default statigen template project.

npx statigen init path/to/new/folder

Templates

By default, html and markdown files will look for a file called _template at their level or above.

HTML templates

Place this comment somewhere in your html file, and that's where the other files will have their content embedded

<!--content-->

For example,

src/file1.md

# Cool title

src/_template.html

<html>
<body>
<!--content-->
</body>
</html>

Produces

__dist/file1.html

<html>
<body>
<h1 id="cool-title">Cool title</h1>
</body>
</html>

Frontmatter

You can add frontmatter to your markdown files which can be used to override certain items. Here are the currently supported values:

  • priority - a number specifying the priority of a file
  • parentPriority - a number to reorder the parent folder for a file
  • title - a title to use instead of the filename
  • parentTitle - a title to use for the parent folder instead of the folder name
  • template - a path to a custom template to use for the current file

Here's how you use it:

some-folder/some-file.md

---
priority: 1
parentPriority: 3
title: Some File
parentTitle: Some Folder
template: custom-template.ejs
---
Actual content
0.5.2

6 months ago

0.5.1

8 months ago

0.5.0

1 year ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.0

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago