Coder Social home page Coder Social logo

jekyll-migrate-permalink's Introduction

jekyll-migrate-permalink

Gem Version

jekyll-migrate-permalink is a plugin that aims to make your life easier if you're considering changing your permalink. I got the idea for this plugin as I was considering a switch from /blog/:title to /title.

A change to your permalink means that any backlinks to your site will break. You have a few options...

  • Redirect all old URLs to the new permalinks.
  • Continue serving old content at your old URL and only use the new permalink style for new content

jekyll-migrate-permalink can help you with either approach.

Installation

This plugin is available as a RubyGem

Add this line to your Gemfile:

group :jekyll_plugins do
  gem 'jekyll-migrate-permalink'
end

Then execute the bundle command to install the gem.

Usage

Redirect all old URLs to the new permalink

The jekyll-redirect-from plugin is available on GitHub pages can be used to for creating redirects. However, to do this you need to update your front matter with a redirect_from specifying the old URL. jekyll-migrate-permalink makes this process painless.

  1. Before changing your permalink style in _config.yml run jekyll migrate-permalink. The front matter will be updated on all your posts with a redirect_from referencing your post's current URL.
  2. Update your permalink in _config.yml
  3. Build your site!

Continue serving old content at old URLs

jekyll-migrate-plugin can also help with this approach. Again, it's painless

  1. Before changing your permalink style in _config.yml run jekyll migrate-permalink --strategy retain. The front matter will be updated on all your posts with a permalink referencing your current post's URL.
  2. Update your permalink in _config.yml
  3. Build your site!

Caveats

Note that the plugin loads the front matter as YAML in order to safely manipulate, and then converts it back to a string. This process may result in some slight formatting changes to your front matter.

jekyll-migrate-permalink's People

Contributors

mpchadwick avatar

Stargazers

 avatar Yubi Lee avatar Kirill Isakov avatar c+aue avatar Jim Withington avatar Leo Merkel avatar  avatar Gerald Bauer avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

thegreatape

jekyll-migrate-permalink's Issues

"jekyll migrate-permalink" fails on Jekyll 3.3.0

I installed the gem with Gemfile and bundle. When I try to run it, I get the following error:

$ bundle exec jekyll migrate-permalink
Configuration file: C:/Users/rachum/code/blog-source/_config.yml
jekyll 3.3.0 | Error:  no implicit conversion of Hash into Integer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.