1

I started using the beautiful Kasper theme for Jekyll. However my blog post URL contains the categories. I don't want it to have them there:.

http://myhost.com:4000/dev,datascience/2013/11/10/mypost.html

How do I remove the dev,datascience categories from that URL?

I'm worried about it because if I change the categories of the blog bost, it would change the URL. I don't want that to happen.

3

Two easy ways to fix this, depending on whether you want to customise just one blog post or make the change site-wide.

For just one post, manually set its URL in the YAML front matter like so:

---
permalink: /2013/11/10/mypost.html
---

To change every post site-wide, you would edit your _config.yml to switch from the default 'date' permalink pattern you currently use, to something like this:

permalink: /:year/:month/:day/:title.html

Remember that if this is a published site, your old links may have been indexed already by search engines (or bookmarked by visitors) so best practice is to set up redirects from the old URLs to the new ones. How has been asked & answered here many times, try '301 redirect' + the name of your server for examples.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.