Hi all,
I have a store I am working on at the moment and using the list.html template with the following code:
list.html
{{ if in (print .RelPermalink) "/store/girls" }}
{{ range (where .Pages "Type" "store") }}
{{ partial "store/girls" . }}
{{ end }}
{{ else if in (print .RelPermalink) "/store/boys" }}
{{ range (where .Pages "Type" "store") }}
{{ partial "store/boys" . }}
{{ end }}
{{ else }}
Store home
{{ end }}
both partials inside the range loop just have a {{ .Title }}
So when I visit /store
I see store home, great, but when I visit either /girls or /boys I see a nothing. Now if I remove {{ if in (print .RelPermalink) "/store/girls" }}
I see the range
and content. Is it possible to have an if
and then a range
? Still new to Hugo but reading all I can about this.
Also can I have multiple list templates? I tried the lookup order but wasn’t able to get the new templates to override the default list.html
template in _default
.
Thanks in advance and sorry for my lack of Hugo expertise.