0.1.1 • Published 7 years ago

penguin-pug-transform v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

penguin-pug-transform

Pug is a high performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and browsers.

This transform compiles pug templates located in components/ of your penguin.js based website to valid penguin components.

Usage

$ npm i -S penguin-pug-transform

Include the transform in your pack and serve commands.

{
  ...
  "scripts": {
    "serve": "penguin serve -t [ penguin-pug-transform ]",
    "pack": "penguin pack -t [ penguin-pug-transform ]"
  }
  ...
}

Then you can create pug templates of the following filename scheme: components/<my-template>.pug

Example

components/my_pug_component.pug

div
  h1 This is my first pug component
  p I can use fields in here: #{fields['title-field']}

Now you can use this component in your page/object:

<div data-component='MyPugComponent'></div>
0.1.1

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago