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

Use of ( and ) to specify order of operations. #910

Closed
rukai opened this issue May 4, 2024 · 2 comments
Closed

Use of ( and ) to specify order of operations. #910

rukai opened this issue May 4, 2024 · 2 comments

Comments

@rukai
Copy link

rukai commented May 4, 2024

I came across some code like:

{%- if config.extra.enable_post_view_navigation and page.lower or page.higher %}

I'm pretty sure its broken since config.extra.enable_post_view_navigation and page.lower evaluates first.
If tera supported brackets for specifying order of operations I could fix the issue by writing it as:

{%- if config.extra.enable_post_view_navigation and (page.lower or page.higher) %}

As a workaround I was able to solve the issue by writing it as:

    {%- if config.extra.enable_post_view_navigation %}
        {%- if page.lower or page.higher %}

But that is not ideal.

@Keats
Copy link
Owner

Keats commented May 4, 2024

There's #908 for tera v1 and it's already handled correctly in v2

@rukai
Copy link
Author

rukai commented May 4, 2024

Oh excellent!
Sorry for the duplicate issue, it wasn't coming up in my searches.

@rukai rukai closed this as completed May 4, 2024
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