loading words...

Jul 03, 2019 19:49:59

Migrating Off WordPress

by @valentino | 235 words | 36🔥 | 334💌

Valentino Urbano

Current day streak: 36🔥
Total posts: 334💌
Total words: 161600 (646 pages 📄)

This is a continuation of my series on migrating my web site off WordPress and onto Jekyll

The WordPress installation left most of the links to other articles as absolute articles. This left the website address in the URL, so when I either change the permalink structure or the website URL they are all going to break.

Note: WordPress uses this style /my-title/ for links. Since Jekyll generates HTML files it uses /my-title.html. Also keep in mind that if you change your permalink structure all the links are going to break. SO be careful every time you think about switching your link scheme and decide it early in the process of creating a new blog (that doesn't mean that you can't change it later if you want to though, but you will need to take precautions). Jekyll has a nice feature to avoid this: Instead of just including the link directly you can do it like this: {% post_url 21-02-2016-migrating-off-wordpress %}. This will return the link to this post and you can include it in any other post or page. You can also use URL rewrite to automatically redirect to the correct url (for example using .htaccess on a server based on apache), the problem is that I'm not using a server since I'm hosting the website on Github pages. I could use web workers on Netlify or Cloudflare, but it seems excessive just to rewrite a few URLs.

contact: email - twitter / Terms / Privacy