Minimal-mistakes: Using jekyll-archives as per the instructions results in blank category and tag archives pages

Created on 3 Dec 2018  路  4Comments  路  Source: mmistakes/minimal-mistakes

Following the instructions in Taxonomy archives, I don't see any posts listed under /categories:

_config.yml

category_archive:
  type: jekyll-archives
  path: /categories/
tag_archive:
  type: jekyll-archives
  path: /tags/
jekyll-archives:
  enabled:
    - categories
    - tags
    - year
  layouts: archive-taxonomy
  permalinks:
    category: /categories/:name/
    tag: /tags/:name/

Gemfile

gem "jekyll-archives"

But when I go to categories, I see the following; clicking on individual category link takes me to a blank page that lists the category name, but no posts.
categories

Even if the links worked, I hate the ugly index page. I think the documentations needs to be clearer about using Jekyll archives plugin vs Liquid. Currently, the instructions go back and forth, and for muggles like me, it's confusing.

I have not copied the category-archive.md to _pages because I got the impression that it's not needed when using jekyll-archives.

Support

Most helpful comment

It is up to how you want to deal with the categories/tags links listed after a post. The default (using Liquid) has them linking to whatever you name your category or tag archive page. In the MM example I'm using /tags/ and /categories/.

Because the Liquid method can't generate individual pages for each taxonomy term, it's linking to ids on the page. That's where you get links like /tags/#your-tag.

image

If you're using Jekyll Archives it will generate the taxonomy pages for you. So you can change the permalinks to link to those directly: /tags/your-tag/index.html. You have to set these up twice... one for the theme so it knows how to generate the links at the end of a post.

category_archive:
  type: jekyll-archives
  path: /categories/
tag_archive:
  type: jekyll-archives
  path: /tags/

And the second set of configs are for Jekyll Archives. The paths for the theme need to match JA's permalinks else you'll have broken links. The documentation states this. Really the only difference is JA has :name at the end.

jekyll-archives:
  enabled:
    - categories
    - tags
  layouts:
    category: archive-taxonomy
    tag: archive-taxonomy
  permalinks:
    category: /categories/:name/
    tag: /tags/:name/

Unfortunately Jekyll isn't really plug and play like Wordpress with a lot of this stuff. It's built for developers, and because of that there's a lot of extra knowledge and know-how you need to have to use the more advanced stuff.

All 4 comments

  1. Turned out the individual *archive.md pages still needed to be copied to _pages; when I did that, the posts did show up and the index page is also nice. This comment from https://github.com/mmistakes/minimal-mistakes/issues/811 should be in the docs.
  2. The following doesn't seem to be necessary:
category_archive:
  type: jekyll-archives
  path: /categories/
tag_archive:
  type: jekyll-archives
  path: /tags/
  1. It's not at all clear if the path from 2 above, permalinks as shown below, and the permalink: /categories/ from category-archive.md should match, or why the same path should be repeated three times.
permalinks:
    category: /categories/:name/
    tag: /tags/:name/
    year: /years/:year/

I've read the Jekyll docs, and the above questions are not answered. I'm keeping the ticket open so that the doc can be made clearer. Based on https://github.com/mmistakes/minimal-mistakes/issues/811, I'm not the only one having trouble with archives :)

There is documentation about this already: https://mmistakes.github.io/minimal-mistakes/docs/configuration/#archive-settings

That portion of the docs doesn鈥檛 answer questions 2 and 3.

It is up to how you want to deal with the categories/tags links listed after a post. The default (using Liquid) has them linking to whatever you name your category or tag archive page. In the MM example I'm using /tags/ and /categories/.

Because the Liquid method can't generate individual pages for each taxonomy term, it's linking to ids on the page. That's where you get links like /tags/#your-tag.

image

If you're using Jekyll Archives it will generate the taxonomy pages for you. So you can change the permalinks to link to those directly: /tags/your-tag/index.html. You have to set these up twice... one for the theme so it knows how to generate the links at the end of a post.

category_archive:
  type: jekyll-archives
  path: /categories/
tag_archive:
  type: jekyll-archives
  path: /tags/

And the second set of configs are for Jekyll Archives. The paths for the theme need to match JA's permalinks else you'll have broken links. The documentation states this. Really the only difference is JA has :name at the end.

jekyll-archives:
  enabled:
    - categories
    - tags
  layouts:
    category: archive-taxonomy
    tag: archive-taxonomy
  permalinks:
    category: /categories/:name/
    tag: /tags/:name/

Unfortunately Jekyll isn't really plug and play like Wordpress with a lot of this stuff. It's built for developers, and because of that there's a lot of extra knowledge and know-how you need to have to use the more advanced stuff.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgyjg picture lgyjg  路  5Comments

muhasturk picture muhasturk  路  3Comments

ashleyconnor picture ashleyconnor  路  4Comments

halirutan picture halirutan  路  4Comments

floatingpurr picture floatingpurr  路  3Comments