jekyll / jekyll-archives

:books: Archive pages for your Jekyll tags and categories.
https://jekyll.github.io/jekyll-archives/
MIT License
438 stars 99 forks source link

"Type-specific layouts" separate for single category #165

Open dzg opened 3 years ago

dzg commented 3 years ago

Regarding "Type-specific layouts"

site.com/categories works using my defined layout:

But how do I specify the layout for site.com/categories/category1 ?

It lists posts with category1 but I don't see how to customize the layout.

dzg commented 3 years ago

OK, so it works with

layout: category_archives
layouts:
  category: category

But in my layout category_archives.html how do I get the category being displayed to use in the title?

SOLVED I used {{ page.posts[0].categories[0] }} to grab the category being listed. Leaving this here if someone else needs this ... or if someone knows a better way. Thanks!