gulp-phug
v1.3.4
Published
Pug to PHP template compiler using phug
Downloads
10
Maintainers
Readme
Gulp Phug
(Formerly gulp-tale-jade
)
Gulp plugin for Phug.
Example usage
const gulp = require( 'gulp' );
const pug = require('gulp-phug');
function templates () {
return gulp.src('./src/*.pug')
.pipe(pug())
.pipe(gulp.dest('./dist'))
}
module.exports = {
default: templates
};
Development Setup
Uses composer
which can be installed via Homebrew with brew install composer
.
Using with WordPress
Install
composer
(PHP's package manager) on your system;Create a folder
mu-plugins
insidewp-content
;Create a folder
phug-renderer
insidemu-plugins/
;Install
phug
;Create a file called
init.php
insidemu-plugins
, with the following content:<?php require_once( WPMU_PLUGIN_DIR . '/phug-renderer/index.php' );
cd
intophug-renderer
and run:composer require phug/phug
Create the file
index.php
inphug-renderer
with the follwing content:<?php include_once __DIR__ . '/vendor/autoload.php';
Done. Now Wordpress will be able to render the PHP generated by the
phug
compiler.
The final structure should be:
mu-plugins/
init.php
phug-renderer/
vendor/
composer.json
composer.lock
index.php