Closed yangqinj closed 5 years ago
Sorry for the delay. My email was broken :)
What version are you using?
So looking at this again, yes, you're adding 4 items to the list, so it's:
1: data{"path", "/"} 2: data{"alias", "Home"} 3: data{"path", "/config"} 4: data{"alias", "Configuration"}
You need to use objects (unordered maps). There are some examples in the tests: https://github.com/kainjow/Mustache/blob/master/tests.cpp#L993
Also you shouldn't need to use the context class directly, just pass data_path_handlers to render instead.
Here I have a template with a section
To render this template, I use the following code to fill the tag:
The resulting output is:
There two wrong points:
path
andalias
are not on the same lineDid I wrongly use the data with data::type::list?