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

Refer the root object by single dot #253

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

kubo
Copy link
Contributor

@kubo kubo commented Sep 1, 2022

This closes #234.

When I have a list of items (could be objects as well) in the json data file.

[
    "item1", "item2","item3"
]

Now when trying to use them in a loop like

## for item in .
{{ item }}
## endfor

Consideration: Is "." appropriate to refer the root document? If not, I'll make another pull request.
Note: This is ad-hoc fix. "." cannot be set as the second or later argument. It may be fixed by #247 though I have not confirmed it.

@drizzle042
Copy link

How about *? I think asterisk is better IMO.

@drizzle042
Copy link

Rendering like so {{.}} causes segfault

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.

Name of root object in for loop
2 participants