simon-dt / gulp-twig

Twig plugin for gulp.js, The streaming build system. Looking for maintainer or collaborators. See wiki
https://github.com/zimmen/gulp-twig/wiki/Looking-for-maintainer-or-collaborator(s)
MIT License
62 stars 33 forks source link

Pass through namespaces option #24

Closed dennisreimann closed 7 years ago

dennisreimann commented 8 years ago

See https://github.com/justjohn/twig.js/wiki#namespaces

gravypower commented 8 years ago

+1 to this

jameschetwood commented 8 years ago

@zimmen Any progress / thoughts on this? Thanks

linnett commented 8 years ago

@zimmen I'm with James here - could this be approved please? We really need to use this feature in production and it would be most helpful! Thanks

simon-dt commented 8 years ago

Sure, i'll get on it this evening.

Op 6 apr. 2016 om 14:57 heeft Samuel Linnett notifications@github.com het volgende geschreven:

@zimmen I'm with James here - could this be approved please? We really need to use this feature in production and it would be most helpful! Thanks

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

linnett commented 8 years ago

@zimmen that's great - thank you!

jameschetwood commented 8 years ago

@zimmen @dennisreimann Thanks a lot! Some documentation would also be great. Ive manually applied the commit while I wait but I can see where to set the namespace.

simon-dt commented 8 years ago

I'll have to look into this myself first. As i'm not using the namespaces myself at the moment.

Op 6 apr. 2016 om 16:14 heeft jameschetwood notifications@github.com het volgende geschreven:

@zimmen Thanks a lot! Some documentation would also be great. Ive manually applied the commit while I wait but I can see where to set the namespace.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

linnett commented 8 years ago

@zimmen hi - did you manage to take a look at this one? thanks

linnett commented 8 years ago

@dennisreimann how did you set namespaces in your gulp task?

dennisreimann commented 8 years ago

@linnett just like the other options:

.pipe(twig({
    namespaces: {
        a: 'a',
        b: 'b'
    }
}))
linnett commented 8 years ago

@dennisreimann thanks - will give it a try

jameschetwood commented 8 years ago

@dennisreimann Did you have this working? Ive manually applied your path and tried the following (and a few syntax variations) but I cant get it working:

Old path:

{% include "../button/button.twig" %}

New settings and path:

.pipe(plugins.twig({
  namespaces: {
    app: '../button/'
},
{% include "@App/button.twig" %}
linnett commented 8 years ago

@zimmen do you know when this will be included and documented?

LoicGoyet commented 8 years ago

I do not make it work either :(. My options into the gulp tasks are :

.pipe(twig({
  namespaces: {
    styleguide: 'src/templates/ts-components'
  }
}))

And then I tried several synthax for an include of the file src/templates/ts-components/section-header.twig into the template src/templates/molecules/callout.twig.

Like into symfony projects :
{% include '@styleguide/section-header.twig' %}
Like documented into the twig.js wiki :
{% include 'styleguide::section-header.twig' %}

I also tried into the config to setup the styleguide namespace as relative or absolute.

None of thoses tries worked, any ideas ? Thanks a lot

LoicGoyet commented 8 years ago

any updates ? :(

Floppery commented 7 years ago

Where need options! Please merge this commit!!!

simon-dt commented 7 years ago

Merged. Along with another PR.

linnett commented 7 years ago

Can we have the documentation updated for this please?

simon-dt commented 7 years ago

It is basically passing it along to twig.js itself. See https://github.com/twigjs/twig.js/wiki#namespaces

I'll put that snippet in the docs as well

linnett commented 7 years ago

Thanks - we'll give it a go

On 27 Oct 2016 10:34 am, "Simon" notifications@github.com wrote:

It is basically passing it along to twig.js itself. See https://github.com/twigjs/twig.js/wiki#namespaces

I'll put that snippet in the docs as well

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zimmen/gulp-twig/pull/24#issuecomment-256594005, or mute the thread https://github.com/notifications/unsubscribe-auth/ACI_wbN9MIBJWCsA2ZaLDx35qBwrrvrxks5q4HAkgaJpZM4HWfSI .