jener

1.0.1 • Public • Published

Jener Build Status

Bare simple static site generator ever.

See https://eguneys.github.io/ for example using Jener.

  1. Define a mix-in:
<!-- #mixin mymixin -->
<head>
</head>
  1. Define a layout and use the mixin:
<!-- #layout main -->
<html>
<!-- #include mymixin -->
<body>
  <!-- #content article -->
</body>
</html>
  1. Define a page using the layout:
<!-- #page main article -->
<div>
  Text
</div>
  1. Run jener in-directory out-directory and, it generates the output file for the page:
<html>
  <head>
  </head>
  <body>
    <div>
     Text
    </div>
  </body>
</html>

It has only 2 features, mix-in and layout, to generate pages.

I asked this question on Stackoverflow which ended up deleted.

Usage

Instal jener globally using yarn global jener.

In a folder, put all your layout, mix-in and page definitions, in separate html files.

Then run jener in-directory out-directory. This will generate all your page definitions inside in-directory into the out-directory.

Details

mix-in named mymixin is defined with #mixin command inside an html comment:

<!-- #mixin mymixin -->

mix-ins cannot include other mix-ins.

layout named main is defined the same:

<!-- #layout main -->

mix-in's are included with a #include command:

<!-- #include head -->

A layout defines area (named article) to replace with content with #content command:

<!-- #content article -->

A page is defined with a #page command. Pages might not have a layout and can use mix-ins:

<!-- #page -->

Pages don't have a name. All pages are exported with the same name as their definition file.

A page with a main layout, is defined as:

<!-- #page main -->

page with a layout must specify which area to replace from the layout.

<!-- #page main -->
<!-- #content article -->

That, replaces #article area.

There is a shorthand for above two commands:

<!-- #page main article -->

A layout can define multiple area's to be replaced and page can specify multiple areas to replace from the layout.

All page definitions export into a separate html file. Output filename is the same as the filename of the page definition.

Contribute

Install dependencies: yarn install. Run the tests: yarn test. Run the examples: yarn example.

Questions about parsing:

Become patreon

Happy blogging 💙

Readme

Keywords

Package Sidebar

Install

npm i jener

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

23.8 kB

Total Files

24

Last publish

Collaborators

  • eguneys