laravel-blade-jade
v2.0.3
Published
Create laravel blade views using jade
Downloads
7
Readme
laravel-blade-jade
Create laravel blade views using jade
Install
$ npm install --save-dev laravel-blade-jade
// Gulpfile.js
const elixir = require('laravel-elixir');
require('laravel-blade-jade');
elixir(mix => {
/**
* Blade Views
*/
mix.blade({
sourcePath: "resources/assets/blade",
locals: {}
});
// ...
});
Usage
Trigger
$ gulp blade
// index.jade
doctype html
html
head
title @yield('title')
body
@include("partials.foo-bar", ['key' => 'val'])
@section('sidebar')
sidebar.master
p This is the master sidebar.
@stop
.container: .row
@yield('content')
<!-- index.blade.php -->
<!DOCTYPE html>
<html>
<head>
<title>@yield('title')</title>
</head>
<body>
@include("partials.foo-bar", ['key' => 'val'])
@section('sidebar')
<sidebar class="master">
<p>This is the master sidebar.</p>
</sidebar>
@stop
<div class="container">
<div class="row">
@yield('content')
</div>
</div>
</body>
</html>
Files containing _*.jade
not be rendered.
API
mix.blade(options)
options
Type: object
All options supported by the Jade API are supported
sourcePath
Type: string
, null
Default: "resources/assets/blade"
outputPath
Type: string
, null
Default: "resources/views"
basedir
Type: string
, null
Default: null
locals
Type: object
Default: {}
pretty
Type: boolean
, string
Default: true
Official Documentations
- Documentation for Elixir can be found on the Laravel website.
- Documentation for Jade can be found on the Jade website.
- Documentation for Elixir repositories can be found on the Github
Notes
If you using version 1.0
please check docs
Related
- bladejs-core - API for this module
License
MIT @ Guntur Poetra