ginus / gulp-slm

Compile Slm templates with gulp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gulp-slm

 

Let's use Slm with Gulp!

doctype html
html
  head
    meta charset="utf-8"
    title = this.title
  body
    h1 = this.title
    p = this.text
var slm = require('gulp-slm');

gulp.task('slm', function() {
  var data = {
    title: 'Hello, world!',
    text: 'Hello world example for slm template.',
  };

  return gulp.src('./src/*.slm')
    .pipe(slm({ locals: data }))
    .pipe(gulp.dest('./build/'));
});
Result
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Hello, world!</title>
  </head>
  <body>
    <h1>Hello, world!</h1>
    <p>Hello world example for slm template.</p>
  </body>
</html>

(whitespace included for readability)


BSD 2-Clause

About

Compile Slm templates with gulp

License:BSD 2-Clause "Simplified" License


Languages

Language:JavaScript 100.0%