Bennet
Bennet

Reputation: 386

Unicode characters in Jekyll category

I'm new to Jekyll and Ruby. I am using it for writing a blog in Polish, which uses non-ASCII characters.

I'd like to use UTF characters in category names - for example, "Świat". Sadly, this leads to the blog post being put in a directory also called "Świat" (with the non-ascii 'Ś' in the name), and the server I am using apparently cannot cope with non-ASCII characters in the URL (I thought non-ascii is not really allowed in URL anyway).

All Polish characters are 'downgradable' to a regular Latin character for the permalink (e.g. 'Ś'->'S'), which seems like the most desirable option here. Is that possible to do automatically somehow? I guess one option would be to manually specify the permalink in the front matter for each post, but that seems cumbersome.

I am using Jekyll 3.2.1, and a template called 'centrarium' in case that matters.

Apologies if that's a noob question, I tried googling around but couldn't really find anything.

Upvotes: 1

Views: 893

Answers (1)

David Jacquel
David Jacquel

Reputation: 52829

Edit :

There is no reason for your server to mess with file or folder names containing accented characters. "Świat" is a valid string for any file system.

And Jekyll's url are well encoded, so, using accented chars in url is fine out of the box.

I've tested it here, just by adding "Świat" as a category to a post. And it works just fine.

Do you have something visible in a repository ?

# End edit

Old answer :

This can be done with a plugin.

But this implies that you can't use github-pages to generate your site. You will have to generate locally and push to your publishing branch (usually gh-pages), or use some Continuous Integration service like Travis.

Upvotes: 1

Related Questions