Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using jekyll-archives as per the instructions results in blank category and tag archives pages #1984

Closed
asarkar opened this issue Dec 3, 2018 · 4 comments

Comments

@asarkar
Copy link

asarkar commented Dec 3, 2018

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.

@asarkar
Copy link
Author

asarkar commented Dec 3, 2018

  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 Documentation not correct for jekyll-archives #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 #811, I'm not the only one having trouble with archives :)

@mmistakes
Copy link
Owner

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

@asarkar
Copy link
Author

asarkar commented Dec 3, 2018

That portion of the docs doesn’t answer questions 2 and 3.

@mmistakes
Copy link
Owner

mmistakes commented Dec 3, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants