(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-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