If your test blog differs from your production blog, that snippet won’t work. Does your test blog have the category set up and posts assigned to that category?
No, it didn’t have any categories. I added those, and now it does work. Now testing on “the big blog.”
It works. A minor issue is that the most recent post points to the very first post, but that’s easy to fix by changing the wording (earlier to previous, later to next).
ETA: Hrm. I just discovered this breaks when paginating. I set my test blog to paginate at 5 posts, and it put the later of two posts from a given day on the first page and the earlier of the two on the second page.
Hey, @jsonbecker, I’ve a question about your “reverse days, chrono posts within days” code, which I played with adapting for Marfa thusly.
The default Marfa file is below. Does anything jump out at you that I need to suss out how to incorporate from the default file that I didn’t already? (I’m not making a request that you do the work for me, just wondering if you see something obvious that I should be looking at. I’m no coder but I’m generally good at understanding code’s logic if I have a pointer or two.) Thanks!
{{ define "main" }}
<ul id="post-list">
{{ if or .IsHome .Site.Params.paginate_categories }}
{{ $paginator := .Paginate (where .Site.Pages.ByDate.Reverse "Type" "post") }}
{{ $list := $paginator.Pages }}
{{ range $list }}
{{ partial "post-item.html" . }}
{{ end }}
{{ else }}
{{ $list := where .Site.Pages.ByDate.Reverse "Type" "post" }}
{{ range $list }}
{{ partial "post-item.html" . }}
{{ end }}
{{ end }}
</ul>
{{ if .IsHome }}
{{ if .Site.Params.paginate_home }}
{{ partial "pagination" . }}
{{ end }}
{{ else if .Site.Params.paginate_categories }}
{{ partial "pagination" . }}
{{ end }}
{{ end }}
I was just tackling the Dave Winer-style blog organization. But now I can’t figure out the problem that erupts upon pagination, which I noticed on your site, too. It’s like it’s counting out the number of posts for the page first, then passing that to the Winery magic, stranding the wrong post on the next page.
I’m pretty sure that’s a Hugo bug and/or some default somewhere in the pagination functions that I haven’t tracked down. I’m quite confident what I wrote is as close as you will be able to find about Hugo anywhere on the internet-- it may be worth asking on the Hugo forums, someone may know what default value I’m hitting into to split them up. It’s also possible it’s a micro.blog oddity, though I doubt it-- there are some times defaults that get picked up set by Micro.blog if they’re not overwritten, but those have been reduced over time.