How can I create an archive page sorted by years (with post count) and months (also with post count)? #906
-
I'd like to have a PaperMod like archive layout for my website. This then also becomes a theme which I'd like to make available for Yellow. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hello Robert! First of all: could you please edit the title and put your question there? For example "Can someone help me create an HTML layout for a blog?" or "Is it possible to customise the feed extension for a specific theme?". Tip: You can use the |
Beta Was this translation helpful? Give feedback.
-
Here's a tip how date and time works in the API for developers. You can get a collection of blog pages and sort them by the publication date. For example with Even if it doesn't answer your question, hope it helps a little bit. |
Beta Was this translation helpful? Give feedback.
The method
pages->group()
is available in the Yellow API now, it supports custom date formats.pages->group("published", false, "Y")
= group content by publication year with descending datepages->group("published", false, "Y-m")
= group content by publication month with descending datepages->group("published", false, "Y-m-d")
= group content by publication day with descending dateHere's an example layout file to show a blog archive with years and months :