I want to make the “source” of my tagcloud configurable. Right now it’s hard coded into a partial and I have one partial per tag cloud “type”:
{{ if not (eq (len $.Site.Taxonomies.tags) 0) }}
...
<div class="text-center">
{{ range $name, $_ := ($.Site.Taxonomies.tags) }}
...
{{ end }}
...
</div>
{{ end }}
Is there any way to have a config.toml param like the following and then in the template somehow to eval
the configuration to retrieve the items?
[params]
tagcloudsource = "$.Site.Taxonomies.tags"
bep
2
No, but while that would be useful in some situations, don’t see why you couldn’t pull those into “partial functions”.
This might be what I am looking for: https://stackoverflow.com/a/37384665/512174
I am not aware yet of “partial functions”… Googling now.
Got it. That makes sense. I didn’t know the returns have a name Should be added to the documentation.
And as always, Regis Philibert (@regis) already covered the exact topic:
The solution to my particular idea is in the chapter “Caching” near the end.
2 Likes
system
Closed
6
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.