Having a hard time figuring out how to address an issue I’m having. I display my last 10 most recent blog posts on my site & in my RSS feed… pretty standard. Some pages use the publishDate
property, others don’t. What I’m seeing is that the date
property is used in the sorting, but publishDate
isn’t used.
What I’d like is to have the most recent say: sort by publishDate
in descending order, but when publishDate
isn’t present, use date
. Is that possible?
Here’s what I currently have…everything I’ve tried so far keeps erroring out… ideas?
{{ range first 10 (where .Site.RegularPages "Section" "blog") }}
{{ partial "blog-list-item" . }}
{{ end }}