0.1.17 • Published 8 years ago

gulp-mustacher v0.1.17

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

gulp-mustacher

MIT License NPM version NPM downloads Build Status Coverage Status

Gulp task build over Mustacher module

Designed for fit my own needs to build HTML static pages. Perfect for templating eZPublish, Magento, Drupal... CMS models

It provide an easy way to include handlebar's partials files inside HTML template page with a minimal list of helpers like repeat (loop), or, and.

Exposed HTML/Handlebar's helpers

blocks helpers
inline helpers

Install

npm install gulp-mustacher --save-dev

Usage

gulpfile.js

var gulp = require('gulp'),
    path = require('path'),
    mustacher = require('gulp-mustacher');

gulp.task('default', function () {
    var options = {
        partials: {
            ext: '.hbs',
            src: 'src/html/partials'
        }
    };
    return gulp.src(path.join('src', '*.tpl'))
        .pipe(mustacher(options))
        .pipe(gulp.dest('build/html'));
});

src/html/index.tpl

<!DOCTYPE html>
<html lang="fr">

<head>
    ....
    <!-- include dist/css/bundle.css in a <link href="... -->
    {{$css 'css/bundle'}}
    <!--
    or include inline styles from a file
    {{$css 'dist/public/css/bundle' true}}
    -->
</head>

<body>

    <div id="before-body">
        ...
    </div>

    <!-- include src/html/partials/header.hbs -->
    {{$include 'header'}}

    <div id="main">
        <!-- include src/html/partials/contents/main.hbs -->
        {{$include 'contents/main'}}
    </div>

    <!-- include src/html/partials/footer.hbs -->
    {{$include 'footer'}}

    <div id="after-body">
        ...
    </div>

</body>

</html>
    

More Documentation & Examples

Take a look at mustacher module for a full documentation

Issues

not yet implemented

  • Lorem Ipsum
0.1.17

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

9 years ago

0.1.10

9 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago