gulp-community / gulp-pug

Gulp plugin for compiling Pug templates
MIT License
521 stars 81 forks source link

Adding gulp-pug-frontmatter-support to the "Also see" section #183

Closed DougBeney closed 6 years ago

DougBeney commented 6 years ago

Hello, Just wanted to share a variation of this plugin I created called "gulp-pug-frontmatter-support"

Using this plugin, this Pug code...

---
title: My Site
---

h1 Welcome!

...Will turn into this:

---
title: My Site
---

<h1>Welcome!</h1>

This is useful for anyone who has a Gulp + Pug setup for a statically generated site. For example, I am using this in my Jekyll-Bliss project.

I thought it might be useful to add this to the "Also see" list in your readme.

phated commented 6 years ago

The linked plugin goes against the gulpplugin ethos. Instead of creating a fork and adding functionality, you should be thinking what sort of plugin you could create that would work in tandem with gulp-pug.

Example (this probably isn't the best API):

gulp.src(...)
  .pipe(frontmatter.extract())
  .pipe(pug())
  .pipe(frontmatter.insert())
  .pipe(gulp.dest(...))
DougBeney commented 6 years ago

Gotcha. Will consider that.

DougBeney commented 6 years ago

Thanks for the feedback! I ended up taking your advice and created a separate plugin: https://github.com/DougBeney/gulp-frontmatter-wrangler

phated commented 6 years ago

@DougBeney awesome! Feel free to submit a PR to the "Also see" section with your new module!