I've copied the Jekyll plugin to generate Category pages using an official source (https://github.com/recurser/jekyll-plugins) into my Github repository and it doesn't work, I keep on getting a 404 page. That said if I test on my local machine both in the Jekyll server and in the _site directory it works. Any ideas?
相关问题
- Jekyll Error “Liquid Exception: undefined method `
- jekyll page build failure
- Inline HTML is escaped by Jekyll
- Including an image in a Jekyll post with custom si
- How to include video tag / mp4 videos in a Jekyll
相关文章
- “no implicit conversion of Integer into String” er
- Check if variable is type of string or array in li
- Jekyll - How can I make avoid a paragraph to be ad
- Why doesn't this Jekyll Liquid where filter fi
- Check for existence of file using Jekyll
- Jekyll: Include HTML partial inside Markdown file
- Ruby/Jekyll unknown error when running -watch
- Defining footnote location with Kramdown/Jekyll
Github pages only support a small number of Jekyll plugins.
If you want to use your plugins, you'll have to generate your site locally and push it on github pages. If you do this, add a
.nojekyll
file at the root of your repository to tell github to not process you files.Another possible solution:
If you don't want to generate your site locally and push the created HTML files to GitHub (like David Jacquel suggested in his answer), you can create one single page with all categories.
Check out this answer:
An easy way to support tags in a jekyll blog
(Note: I'm using tags instead of categories there, but both work exactly the same way in Jekyll as far as I know. So you can just take my code and replace
site.tags
bysite.categories
)I admit, one page per category looks nicer, but my solution has the advantage that it works on Github Pages (because it's just vanilla Liquid, no plugin).
EDIT:
In the meantime, I wrote a blog post how to make separate pages per category without using a plugin:
Separate pages per tag/category with Jekyll (without plugins)
GitHub Pages does not support most plug-ins. They don't want anything crazy going on behind the scenes.
Here's how I do categories with Github Pages. It is not wholly automatic, as it requires a separate .html file for each category you want to set up. But it works without any plugins or wizardry on Github Pages.
Create a categoryname.html file in your root directory. For example,
hardware.html
for a Hardware category. Run a for loop on all of the site's posts and check the post.categoryIn your posts, you would use the
YAML
header to add the category to the post. Like the code below:That should do it. It'll create a
/hardware/
page that will include all of your posts with the Hardware category. Make sure you're case-sensitive on yourYAML
and category names (hardware != Hardware and category != Category
).