While searching for my issue, I figured I’d ask here instead of creating a new thread.
For the list page:
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "psychedelics") }}
{{ range $paginator.Pages }}
...
For the Related Article Partial:
{{ $related := .Site.RegularPages.Related . | first 16 }}
{{ with $related }}
I am using the above code in my templates, and in the content/psychedelics/_index.md with some front matter:
+++
title="Psychedelic Research"
description="Explore the best resources in the psychedelic world"
hidden="true"
banner = "/img/banners/dream/4.jpg"
+++
It seems that this _index.md is being included in my loops even though I am using .Site.RegularPages.
https://dev.psychedelicsdaily.com/psychedelics/salvia/what-is-salvia-divinorum/ - toward the bottom of the page on Also Related Articles section, and on https://dev.psychedelicsdaily.com/psychedelics/ list page
Here’s some code from the layouts/section/psychedelics.html list template:
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "psychedelics") }}
{{ range $paginator.Pages }}
<section class="post shadow box bg4">
<div class="row">
<div class="col-md-4">
<div class="image shadow">
<a href="{{ .Permalink }}">
{{ if .Params.banner }}
<img src="/img/placeholder.png" data-src="{{.Site.BaseURL}}{{ .Params.banner }}" class="img-responsive" alt="">
{{ else }}
<img src="/img/placeholder.png" class="img-responsive" alt="">
{{ end }}
</a>
</div>
</div>
<div class="col-md-8 post-meta">
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<p>{{.Description}}</p>
<div class="clearfix">
<p class="author-category">
<!--{{ if isset .Params "author" }}
{{$author := index .Site.Params.authors (.Params.author) }}
<a class="" href="{{$baseurl}}authors/{{ .Params.authors | urlize }}/"><i class="fa fa-user" aria-hidden="true"></i>{{$author.display_name}}</a>
{{ end }}-->
{{ range $index, $tag := .Params.tags }}
<a class="" href="{{$baseurl}}tags/{{ $tag | urlize }}/"><i class="fa fa-hashtag" aria-hidden="true"></i>{{ $tag }}</a>,
{{ end }}
<!--{{ if isset .Params "categories" }}
{{ if gt (len .Params.categories) 0 }}
<a href="{{ $.Site.BaseURL }}categories/{{ index .Params.categories 0 | urlize | lower }}"><i class="fa fa-folder" aria-hidden="true"></i>{{ index .Params.categories 0 }}</a>
{{ end }}
{{ end }}-->
<br>
<a href="{{ .Permalink }}"><i class="fa fa-clock-o"></i> {{ .Date.Format .Site.Params.date_format }}</a>
</p>
</div>
<!--<p class="read-more"><a href="{{ .Permalink }}" class="btn btn-template-main shadow"><i class="fa fa-list-alt" aria-hidden="true"></i> {{ i18n "continueReading" }}</a>
</p>-->
</div>
<!--<div class="article-share" style="text-align: left;">
{{ partial "share.html" .}}
</div>-->
</div>
</section>
{{ end }}
Partial for Related.html
<div class="related">
{{ $related := .Site.RegularPages.Related . | first 16 }}
{{ with $related }}
<div><h2>See Also Related Articles</h2></div>
<div class="row">
{{ range . }}
{{ if ne .Section "" }}
<div class="col-md-3 col-sm-6">
<div class="box-image-text">
<div class="top">
<div class="image shadow" style="overflow:hidden">
<a href="{{ .RelPermalink }}">
{{ if isset .Params "banner" }}
<img src="{{ .Site.BaseURL}}img/placeholder.png" data-src="{{ .Site.BaseURL}}{{ .Params.banner }}" class="img-responsive shadow" alt="{{.Title}}" width="255" height="192" title="{{.Title}}">
{{ else }}
<img src="{{ .Site.BaseURL}}img/placeholder.png" class="img-responsive" alt="{{.Title}}" width="255" height="192" title="{{.Title}}">
{{ end }}
</a>
</div>
<a href="{{ .RelPermalink }}"><h4>{{ .Title }}<h4></a>
</div>
</div>
</div>
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
They both render very wrongly. They both have an href = https://dev.psychedelicsdaily.com/psychedelics/
I am using Hugo vesion 0.69 (latest) and a heavily modified Hugo Universal Theme
I can’t seem to exclude this. Any advice?
Here is the git repo: https://gitlab.com/hashborgir/psychedelicsdaily.com-hugo.git I’ve made it public.