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

Adds custom 'filters' to the nunjucks templating engine #200

Merged
merged 1 commit into from
May 26, 2016
Merged

Adds custom 'filters' to the nunjucks templating engine #200

merged 1 commit into from
May 26, 2016

Conversation

paulmsmith
Copy link
Contributor

@paulmsmith paulmsmith commented May 24, 2016

Clean PR to merge the basic functionality of adding custom filters to the nunjucks template engine used by the gov.uk prototyping kit.

lib/core_filters.js is where I propose any future filters we want to include within the kit live. Which could be for example @edwardhorsford's proposed standard date filter

app/filters.js is where bespoke filters for each instance of the kit would live (where users will add their own filters).

cc: @joelanman

@joelanman
Copy link
Contributor

hey could you add this example page? https://gist.github.com/joelanman/1b9cbab0086af57e2f267daf35bfd48e

@joelanman
Copy link
Contributor

actually I might as well make that PR

@joelanman joelanman merged commit 899e07d into alphagov:master May 26, 2016
@joelanman joelanman mentioned this pull request May 27, 2016
@timpaul
Copy link
Contributor

timpaul commented May 29, 2016

Just tried this on another machine and got this error:

/Users/timpaul/code/govuk_prototype_kit/server.js:48 filters = Object.assign(coreFilters, customFilters); ^ TypeError: Object function Object() { [native code] } has no method 'assign'

@paulmsmith
Copy link
Contributor Author

Ah... What version of Node is that machine running? Myself and Joel thought
we might be safe dropping lodash dependency as Node ES6 coverage was
looking good but that will likely depend on what version of node you're
running.

Looking at this matrix: http://node.green/ we felt we might be fine.

On Sunday, 29 May 2016, Tim Paul notifications@github.com wrote:

Just tried this on another machine and got this error:

/Users/timpaul/code/govuk_prototype_kit/server.js:48
filters = Object.assign(coreFilters, customFilters);
^
TypeError: Object function Object() { [native code] } has no method
'assign'


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#200 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AADe39yklr_wgul-kzJsIezwgVSg5SjXks5qGatjgaJpZM4IlaA8
.

Regards,
Paul Smith
---------------------------------
Airfront Media Ltd
Front-end Development & Design
---------------------------------
Tel: *+44 0161 7957792
*URL: *http://www.airfront.co.uk
*skype:
airfront-paulsmith
---------------------------------

@joelanman
Copy link
Contributor

@timpaul what version of node? node -v

@timpaul
Copy link
Contributor

timpaul commented May 29, 2016

Yeah, it was an old 0.x version. I updated and was good to go.

On 29 May 2016, at 16:38, Paul Michael Smith notifications@github.com wrote:

Ah... What version of Node is that machine running? Myself and Joel thought
we might be safe dropping lodash dependency as Node ES6 coverage was
looking good but that will likely depend on what version of node you're
running.

Looking at this matrix: http://node.green/ we felt we might be fine.

On Sunday, 29 May 2016, Tim Paul notifications@github.com wrote:

Just tried this on another machine and got this error:

/Users/timpaul/code/govuk_prototype_kit/server.js:48
filters = Object.assign(coreFilters, customFilters);
^
TypeError: Object function Object() { [native code] } has no method
'assign'


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#200 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AADe39yklr_wgul-kzJsIezwgVSg5SjXks5qGatjgaJpZM4IlaA8
.

Regards,
Paul Smith
---------------------------------
Airfront Media Ltd
Front-end Development & Design
---------------------------------
Tel: *+44 0161 7957792
*URL: *http://www.airfront.co.uk
*skype:
airfront-paulsmith
---------------------------------

You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@paulmsmith paulmsmith deleted the feature/custom_nunjucks_filters branch May 31, 2016 07:39
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

Successfully merging this pull request may close these issues.

3 participants