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 Eleventy-provided filters in user configuration file. #284

Closed
rolandtoth opened this issue Oct 25, 2018 · 5 comments
Closed

Access Eleventy-provided filters in user configuration file. #284

rolandtoth opened this issue Oct 25, 2018 · 5 comments

Comments

@rolandtoth
Copy link

For images I use this syntax:

<img src="{{ (cfg.urls.images + "/map.png") | url | cacheVersion }}" alt="">

This works fine but I would like to shorten this to something like this:

<img src="{{ "/map.png" | urlHelper("images") }}" alt="">

Then the urlHelper filter would add the "url" and "cacheVersion" filters. Is it possible somehow, or is any other recommended way?

@zachleat
Copy link
Member

Ah, so you want access to Eleventy-provided filters in your configuration file. Hmm, I don’t think we currently provide a way to do this, no. It will need to go into the enhancement queue. Please upvote!

@zachleat zachleat changed the title Invoke filter from within another filter Access Eleventy-provided filters in user configuration file. Oct 30, 2018
@zachleat
Copy link
Member

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open.

The enhancement backlog can be found here: https://github.com/11ty/eleventy/issues?utf8=%E2%9C%93&q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc+

Don’t forget to upvote the top comment with 👍!

@zachleat zachleat added enhancement needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved. labels Oct 30, 2018
@zachleat zachleat removed the needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved. label Feb 21, 2020
@zachleat
Copy link
Member

Shipping with 0.11.0

@zachleat zachleat added this to the Eleventy v0.11.0 milestone Feb 21, 2020
@zachleat zachleat reopened this Feb 21, 2020
@zachleat
Copy link
Member

Reopening for documentation add

@zachleat
Copy link
Member

Configuration API method getFilter

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

No branches or pull requests

2 participants