1.3.4 • Published 5 years ago
gulp-phug v1.3.4
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-pluginsinsidewp-content; - Create a folder
phug-rendererinsidemu-plugins/; - Install
phug; Create a file called
init.phpinsidemu-plugins, with the following content:<?php require_once( WPMU_PLUGIN_DIR . '/phug-renderer/index.php' );cdintophug-rendererand run:composer require phug/phugCreate the file
index.phpinphug-rendererwith the follwing content:<?php include_once __DIR__ . '/vendor/autoload.php';Done. Now Wordpress will be able to render the PHP generated by the
phugcompiler.
The final structure should be:
mu-plugins/
init.php
phug-renderer/
vendor/
composer.json
composer.lock
index.php