Open davidsneighbour opened 2 years ago
Call:
{{- $filteredValue := partials.Include "func/filter.html" ( collections.Dictionary
"filter" "filtername"
"context" . ) -}}
The required parameter is filter
with the filter name. everything else depends on the filter and its documentation.
Configuration (copy paste from the current hooks docs):
In params.toml (or under the [params] section of the configuration) add a table array as such:
[[dnb.hooks.filters.namespace.filtername]]
file = "partial path"
weight = "integer"
cached = "boolean/string"
# proper sample
[[dnb.hooks.filters.namespace.urlfilter]]
file = "func/urlfilter.html"
weight = 100
cached = false
Notes:
Note that the cached option is a work in progress. I'll need to find ways to cache, for instance, according to section. This might change over time.-
WIP: see 5669337d51e92ced5888c5960dc8dba29ecdbfac and 36a03c33ad2ba2cf718a4414d129fd5182d21a89
WordPress filter feature for GoHugo basically. Hand data to a filter(-hook) partial and if a filter partial exists for that filter term then run the data through it and return whats returned or the data unchanged.