heyloura
heyloura

Some minor blog tweaks today. I updated my little pixel avatar and I changed how I was grouping posts (thanks to @jsonbecker for the inspiration 😊).

|
Embed
Progress spinner
In reply to
jrr
jrr

@heyloura Could you please share the code snippet, that does this. Thanks.

|
Embed
Progress spinner
heyloura
heyloura

@jrr So the first thing that needs to happen is to group the posts by date. There should be something similar to:

{{ range (.Paginate (where .Site.Pages "Type" "post") 10).Pages}}

that you need to alter to

{{ range (.Paginate (where .Site.Pages "Type" "post") 10).Pages.GroupByDate "January 2, 2006" }}

That change gives you access to the {{ .Key }} which is the date and then {{ .Pages }} which is a collection that corresponds to that date.

Then you need to sort the {{ .Pages }} in reverse. That's accomplished by {{ range .Pages.Reverse }}.

Here is a simple example. Hope that helps 😄

|
Embed
Progress spinner
numericcitizen
numericcitizen

@heyloura Hugo / Javascript is so complicated...

|
Embed
Progress spinner