minimal-mistakes: Documentation not correct for jekyll-archives

  • This is a question about using the theme.
  • I have updated all gems with bundle update.
  • I have tested locally with bundle exec jekyll build.

Environment informations

  • Minimal Mistakes version:
  • github-pages or jekyll gem version: github-pages 118
  • Operating system: Windows 10

Expected behavior

/tags/ and /categories/ working

Steps to reproduce the behavior

Just forked and followed the instructions. But I couldn’t get the instructions to work to generate tags and categories links.

I think the mistake is that the Gemfile is missing the reference to jekyll-archives and that the instructions do not mention that in the _config.yml has the `jekyll-archives section needs to uncommented.

# Archives
#  Type
#  - GitHub Pages compatible archive pages built with Liquid ~> type: liquid (default)
#  - Jekyll Archives plugin archive pages ~> type: jekyll-archives
#  Path (examples)
#  - Archive page should exist at path when using Liquid method or you can
#    expect broken links (especially with breadcrumbs enabled)
#  - <base_path>/tags/my-awesome-tag/index.html ~> path: /tags/
#  - <base_path/categories/my-awesome-category/index.html ~> path: /categories/
#  - <base_path/my-awesome-category/index.html ~> path: /
category_archive:
  type: liquid
  path: /categories/
tag_archive:
  type: liquid
  path: /tags/
# https://github.com/jekyll/jekyll-archives
# jekyll-archives:
#   enabled:
#     - categories
#     - tags
#   layouts:
#     category: archive-taxonomy
#     tag: archive-taxonomy
#   permalinks:
#     category: /categories/:name/
#     tag: /tags/:name/

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (17 by maintainers)

Commits related to this issue

Most upvoted comments

The theme docs mention you need the Jekyll Archives plugin, which has a link to their instructions on how to install it. I just assumed anyone who wanted to go that route would read-up on the plugin and how to install/setup.

It’s not installed by default because it doesn’t work with GitHub Pages. To install gem install jekyll-archives or add it under the plugins group in your Gemfile

group :jekyll_plugins do
  gem "jekyll-archives"
end

Then run bundle install.

Happy to accept pull requests to make the theme docs more clear.

@kblife Your jekyll-archives config is way off that’s why it’s not working. Topics isn’t an array it knows anything about, nor Jekyll for that matter. It only works for tags and categories.

Your best bet is to use categories as topics (which I think you’re trying to do), but to do that you need to configure it that way properly. Then use the permalink paths as you have so instead of “category” in the URL it’ll have “answers/topics”

You’re are setting a Jekyll Archives layout that the theme doesn’t have, unless you’ve built that yourself. You’ll want to repurpose the archive-taxonomy like so.

jekyll-archives:
  enabled:
    - categories
  layouts:
    category: archive-taxonomy
  permalinks:
    category: /answers/topics/:name/

If this doesn’t work I’d suggest reading up on how the Jekyll Archives plugin works and reaching out for help with them. It appears to me you’re having issues with that more than the theme. Which I don’t support.

Ahhh, now I understand:

  1. If I want a taxonomy (tag/category) index, I need _pages/category-archive.html and _pages/tag-archive.html as described above, regardless of whether I use jekyll-archives or not.
  2. If I use pure liquid, taxonomy links would simply point to the corresponding index page above with a hash link, e.g.: https://mysite.com/categories/#foo (so that the entire index opens but the browser jumps to the corresponding section in the index).
  3. If I use jekyll-archives, taxonomy items get their own proper page automatically generated pointed to by “real” (non-hash) links, e.g.: https://mysite.com/categories/foo (which is independent of the full taxonomy index).

You don’t. jekyll-archives only generates archives for specific taxonomies (or dates if configured). It doesn’t create an index page that lists all posts grouped by category or tag, which is what those links above do.

For example if you have a post with categories: foo, bar. Depending on your permalink structure you’ll get something like /categories/foo/index.html and /categories/bar/index.html. What you won’t get is /categories/index.html

Make sense?

@ohadschn Yeah you can. You have to manually add a “posts by category” page. Same for tags. The source for both are in the /docs/_pages folder (as mentioned a few comments above).

You can certainly do it that way. For the theme I approached it with a slightly DRYer approach (Don’t Repeat Yourself). Instead of creating layouts for the category page and another one for tags they both use the same _layouts/archive.html. Less files to maintain that way.

Then each page (categories/tags) use the group-by-array helper to construct the appropriate for loops. Both of these pages are provided as samples to get you started and are mentioned in the documentation. I could probably call them out more since they’re often missed.