thinwybk
thinwybk

Reputation: 4753

How can I get category page hyperlinks of my Jekyll website hosted on GitHub working?

For a Jeykll website hosted on GitHub I created a custom solution (no Jeykll plugin) to display all post links of a category on a page *. I use the setup of GitHub pages for local Jekyll builds and build with bundle exec jekyll serve locally. If visit http://127.0.0.1:4000 and push one of the hyper-link buttons Embedded, Hardware or Software in the left side-bar below Pattern Categories the post links are shown like expected.

However if I visit the website hosted on GitHub I get an "404 File not found" error. From the past I can remember that this could relate to a different handling of Jekylls permalinks in local and GitHub Pages builds. But I cannot remember in detail.

It would be great if someone could help me out.

* Sitenote: Right now instead of listing only the post links for a single category the post links of all categories are listed section wise. But that does not matter w.r.t. to this question.

Upvotes: 0

Views: 52

Answers (1)

marcanuy
marcanuy

Reputation: 23962

The problem is that the website isn't located at the root level, so you need to use in _config.yml the base url:

baseurl: /design-pattern-references

Then make use of that setting generating full paths, e.g.: in _layouts/index.html

 <a href="{{ post.url | absolute_url }}">{{ post.title }}</a>

Upvotes: 3

Related Questions