AakLak
June 20, 2019, 7:54am
1
Edit: I’ve figured it out.
Removed the .Site
before .Pages
in list.html at:
{{ $paginator := .Paginate (where .Site.Pages "Section" "in" .Site.Params.mainSections) }}
Github - https://github.com/AakLak/RSBotSpot
Recently updated from Hugo 0.52 to 0.55.
Don’t believe I changed anything else.
All of a sudden I’m seeing a post with the title “Posts” and same date as my latest post in my list of posts.
Seems to only happen locally?
I believe this is the file that generates the list of posts?
{{ define "schema-dot-org" }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Blog",
{{- /* Google recommends the headline be no more than 110 characters */}}
"headline": "{{ substr .Site.Title 0 110 }}",
"url" : "{{ printf "%s" .Permalink }}",
"author": {
"@type": "Person",
"name": "{{ .Site.Params.author }}"
},
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- if not .Date.IsZero }}
"dateModified": "{{ .Date.Format $ISO8601 }}",
{{- end }}
{{- with .Site.Social.GooglePlus }}
"publisher": "{{ printf "%s" . }}",
{{- end }}
{{- /* all of the site's categories/tags, from Hugo's tpl/template_embedded.go */}}
This file has been truncated. show original
Any advice is appreciated.
Thanks
Try using .Site.RegularPages
instead.
The Posts
page you are getting is the section page /post/
.
2 Likes
I will try this out soon. I have the same issue with “posts” items coming up in my archive ranges. Probably too because .Site.Pages goes through all pages in the section.
pointyfar:
.Site.RegularPages
correct - this did the trick.
1 Like
AakLak
June 20, 2019, 10:15pm
5
Thanks for this.
Read through the Page Variable docs and ended up using that, all good now.