Show X if on page of a section, else Y


Newbie here, I hope I’m explaining myself correctly:

I have a sidebar that shall show an article navigation menu on the article pages of a certain section, but not on that section’s list page. On that and all other pages, it shall show some generic sidebar stuff.

The code below is what I currently have. It is of course showing on the list page for that section. How can I target only the “sub” pages of the “articles” section, so that the article navigation only shows when looking at articles and not the list view for that section? Thanks!

{{ if eq .Section “articles” }}
{{ partial “nav-articles.html” . }}
{{ else }}
{{ $sides := where .Site.RegularPages “Section” “side” }}
{{ range $sides.ByDate.Reverse }}
{{ partial “sides.html” . }}
{{ end }}
{{end }}

{{ if and ( eq .Section "articles" ) ( eq .Kind "page" ) }}

1 Like

Thanks for the quick answer, and that did the trick!