Nunjucks Filter per deployment

15 views
Skip to first unread message

Fotis Paraskevopoulos

unread,
Apr 8, 2015, 12:14:48 PM4/8/15
to apostr...@googlegroups.com
Hello Tom,

We have several custom nunjucks filters which are locale dependant. Is it possible to define these filters on a per deployment basis, I was thinking that I could add them to [deployed]/data/local.js but could not quite figure it out.

I could write my own stuff in an after init module, but I am sure you have already thought about that scenario :)

Any ideas?

FP

Tom Boutell

unread,
Apr 8, 2015, 12:19:46 PM4/8/15
to apostr...@googlegroups.com
Anything in data/local.js is merged with your app.js configuration object.

So, you could merge in more locals there, yes.

(Don't let the unfortunate reuse of the same word "local" confuse you, these are separate concepts. But, since the "locals" property lives in your apostrophe-site configuration object, it is fair game to also include in your data/local.js object.)

--
You received this message because you are subscribed to the Google Groups "apostrophenow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apostropheno...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


THOMAS BOUTELL, DEV & OPS
P'UNK AVENUE | (215) 755-1330  |  punkave.com

Tom Boutell

unread,
Apr 8, 2015, 12:20:36 PM4/8/15
to apostr...@googlegroups.com
However, I would not do that, it sounds like an easy way to lose track of that code or get stuck editing on servers.

Instead I would set a flag in data/local.js and have my functions check that flag to decide how to behave.
Reply all
Reply to author
Forward
0 new messages