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

njk filter returns empty if there's another async filter #93

Closed
fserb opened this issue May 2, 2021 · 2 comments
Closed

njk filter returns empty if there's another async filter #93

fserb opened this issue May 2, 2021 · 2 comments

Comments

@fserb
Copy link
Contributor

fserb commented May 2, 2021

here's the case.
If you have a config: site.filter('x', async () => "hello", true);
and a page A that uses {{ x }}.

If you need to render content from page A into page B: {{ A.page.content }} (pre rendered content) will work. But {{ A.page.content | njk }} will return empty.

This is useful to render content of RSS feeds, where you don't want A.content (the full rendered page) but still want to resolve the templates.

I think the problem is that the njk plugin/filter should either assume it's async by default or have an option to become so.

oscarotero added a commit that referenced this issue May 3, 2021
@oscarotero
Copy link
Member

I've made some changes and now njk filter is async. Can you test it now?

@fserb
Copy link
Contributor Author

fserb commented May 3, 2021

Yep! It works now! :)

@fserb fserb closed this as completed May 3, 2021
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