Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to default plugins #9

Closed
mnmly opened this issue Apr 14, 2012 · 3 comments
Closed

Access to default plugins #9

mnmly opened this issue Apr 14, 2012 · 3 comments
Assignees

Comments

@mnmly
Copy link

mnmly commented Apr 14, 2012

Do you have any plan on exposing default plugins?

I have a case where I just wanted to add moment.js to local context, but I ended up copy&paste-ing JadeTemplate, as it's not exposed to wintersmith….

It would be great if I can have an access to it, so that I can write this instead:

moment      = require 'moment'


module.exports = (wintersmith, callback) ->

  class JadeMomentTemplate extends wintersmith.TemplatePlugin.jade

    render: (locals, callback) ->
      locals.moment = moment
      super

  wintersmith.registerTemplatePlugin '**/*.jade', JadeMomentTemplate

  callback()

Let me know your opinion of adding external modules to local context, if you have solved this case somewhere already :)

@jnordberg
Copy link
Owner

I agree they should be exposed, I'll add it in the next release.

I'm thinking something like wintersmith.plugins.JadeTemplate or perhaps wintersmith.defaultPlugins since 3rd party plugins wont be added to that object

@ghost ghost assigned jnordberg Apr 15, 2012
@mnmly
Copy link
Author

mnmly commented Apr 15, 2012

since 3rd party plugins wont be added to that object

Right, wintersmith.plugins.JadeTemplate or wintersmith.defaultPlugins look suitable :)

Other than that, it's pretty neat app to setup, great work!

@jnordberg
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants