Norway Porridge Makers

    gulp-phug

    1.3.4 • Public • Published

    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

    Install

    npm i gulp-phug

    DownloadsWeekly Downloads

    11

    Version

    1.3.4

    License

    MIT

    Unpacked Size

    1.2 MB

    Total Files

    545

    Last publish

    Collaborators

    • tmslnz