Mobile app version of vmapp.org
Login or Join
Gonzalez347

: How to remove categories from Jekyll Kasper theme blog post URLs I started using the beautiful Kasper theme for Jekyll. However my blog post URL contains the categories. I don't want it

@Gonzalez347

Posted in: #Blog #Jekyll #Theme #Url #UrlKeywords

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:.
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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gonzalez347

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cody1181609

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme