Skip to content

Pug (Jade) to PHP template compiler using Tale-Jade

License

Notifications You must be signed in to change notification settings

tmslnz/gulp-phug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm

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

  1. Install composer (PHP's package manager) on your system;

  2. Create a folder mu-plugins inside wp-content;

  3. Create a folder phug-renderer inside mu-plugins/;

  4. Install phug;

  5. Create a file called init.php inside mu-plugins, with the following content:

    <?php
    
    require_once( WPMU_PLUGIN_DIR . '/phug-renderer/index.php' );
  6. cd into phug-renderer and run: composer require phug/phug

  7. Create the file index.php in phug-renderer with the follwing content:

    <?php
    
    include_once __DIR__ . '/vendor/autoload.php';
  8. 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