(Formerly gulp-tale-jade)
Gulp plugin for Phug.
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
};Uses composer which can be installed via Homebrew with brew install composer.
-
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/phug -
Create 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