Coder Social home page Coder Social logo

orcunsaltik / gulp-pug-3 Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 40 KB

Gulp plugin for compiling Pug templates using the latest stable version of Pug Template Engine.

Home Page: https://www.npmjs.com/package/gulp-pug-3

License: MIT License

JavaScript 100.00%
pug pug-templates gulp-plugin gulp gulp-plugins javascript html js jade jade-templates es6 nodejs node node-js node-module gulp4 gulpjs gulpjs-4

gulp-pug-3's Introduction

Gulp Pug 3

Build Status Dependency Status devDependencies Status Maintainability Snyk Vulnerabilities for GitHub Repo npm NPM Version contributions welcome node-current

Compiles your pug templates into 'html' or 'js' easily and always uses the latest stable version of Pug Template Engine.

Install

npm install --save-dev gulp-pug-3

Api

In addition to Pug's API: client, extension and locals options are available.

Example

const pug = require('gulp-pug-3');

gulp.task('build', () =>
    gulp.src('public/**/*.pug')
        .pipe(
            pug({ 
                // Your options.
            })
        )
        .pipe(gulp.dest('dist'));
);

gulp.task('build:X', () => 
    gulp.src('public/**/*.pug')
        .pipe(
            pug({
                   locals: { dir: 'rtl', lang: 'es' },
                extension: 'htm',
                // Pug API default opts...
                  basedir: `${__dirname}/public`
            })
        )
        .pipe(gulp.dest('dist'));
)

Troubleshooting

When you encounter a problem, please open an issue. I would be glad to help you to find a solution if possible.

Author

Github: @orcunsaltik

License

See the LICENSE file for license rights and limitations (MIT).

gulp-pug-3's People

Contributors

eth-p avatar orcunsaltik avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

mattpr vintsm

gulp-pug-3's Issues

Extends path does not work

Thanks for the pug3 implementation. Im having difficiluties with extending templates. The following line extends ../_layouts/archive.pug in a /Users/.../project/src/pug/some-page.pug results in error:

Error: gulp-pug-3: Error: ENOENT: no such file or directory, open '/Users/.../project/src/_layouts/page.pug'
    at /Users/.../project/src/pug/pages/some-page.pug line 1
  1. I do not extend _layouts/page.pug in some-page.pug but _layouts/archive.pug (it does not extends the page template neither)
  2. the resulting path is wrong anyway (is src/_layouts/page.pug instead of src/pug/_layouts/page.pug)

Everything works with no problem using gulp-pug package

Any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.