GithubHelp home page GithubHelp logo

jener's Introduction

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 ๐Ÿ’™

jener's People

Contributors

eguneys avatar

Stargazers

Leo Wilson avatar Mohammad avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.