WinterJules
WinterJules

Reputation: 93

Broken Permalinks in Jekyll

Instead of outputting the posts as

example.com/2017/02/title

it outputs it as

example.com/201702title

right now posts only open as

example.com/title

I'm using https://github.com/biomadeira/jasper template

Upvotes: 0

Views: 139

Answers (2)

marcanuy
marcanuy

Reputation: 23952

In _config.yml it has the following permalink:

permalink: /:title

That means it will generate posts urls based in their titles.

To have them in this form example.com/2017/02/title you need to change the permalink definition, you have several predefined types for example:

  • permalink: date generates example.com/2017/02/title

You have more combinations here

update

Tested it locally and found the error, the correct permalink value would be just date, you can check post links are working right with:

{% for post in site.posts %}
{{post.url}}
{% endfor %}

But the site is using urls from a custom tag plugin in: https://github.com/biomadeira/jasper/blob/master/_plugins/jekyll-catgenerator.rb which does not handle this and generates wrong urls for posts, you can fix the generator or avoid using it, using instead something like the previous code.

Upvotes: 1

ashmaroli
ashmaroli

Reputation: 5444

The reason is because your template is configured that way.

The solution is to simply comment out this permalink definition when Jekyll will fallback to the default date setting.

Upvotes: 0

Related Questions