jekyll-migrate-permalink 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9aa3e159978a144363692cb37c043400820b1aaf
4
- data.tar.gz: 551ad25d8bd6fdda11bcbdff51e1f3d0e2d09ba0
3
+ metadata.gz: a90cd8a179f79d35c4cb92ce235689a3d27f66b5
4
+ data.tar.gz: bf0d198b1a92a1250f8ef3d351ed975da4007b2b
5
5
  SHA512:
6
- metadata.gz: 5a2463d4a9768ab3c57464084a1e0ee024d66cdc0979c3d06de567b199c70fd872cdd689f13194a6cc74d7e01676215669b123bfe1090115fba75fb390b78583
7
- data.tar.gz: f769390180c7f7b2318fd11001c6f401ea292953d7f94cf6acbf2f5ba6592905a8cac1cf671a60d0347e1446b3a1d1667fc48de41489d91ab1eb47d65d034e2c
6
+ metadata.gz: d169b5c1de9ae5e8350dd89d4308781d50eab11821c0f22d8842f26f1262ddbc26c69af7c335cbffece809119b2e76a33c33bbe78199287149e7c2f308224983
7
+ data.tar.gz: 88d3f4d84b8d81b69cd960e78d4278cbde19d5fc9eb2d89cf136d3a1bf858c4ce276c888ae63b9e29e020c5a7b0e6c971b246a14eacf057fa326fafaf2f072b8
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # jekyll-migrate-permalink
2
2
 
3
- ### What Is This?
4
-
5
3
  `jekyll-migrate-permalink` is a plugin that aims to make your life easier if you're considering changing your [permalink](https://jekyllrb.com/docs/permalinks/). I got the idea for this plugin as I was considering a switch from `/blog/:title` to `/title`.
6
4
 
7
5
  A change to your permalink means that any backlinks to your site will break. You have a few options...
@@ -11,6 +9,22 @@ A change to your permalink means that any backlinks to your site will break. You
11
9
 
12
10
  `jekyll-migrate-permalink` can help you with either approach.
13
11
 
12
+ ## Installation
13
+
14
+ This plugin is available as a [RubyGem](https://rubygems.org/gems/jekyll-migrate-permalink)
15
+
16
+ Add this line to your `Gemfile`:
17
+
18
+ ```ruby
19
+ group :jekyll_plugins do
20
+ gem 'jekyll-migrate-permalink'
21
+ end
22
+ ```
23
+
24
+ Then execute the `bundle` command to install the gem.
25
+
26
+ ## Usage
27
+
14
28
  ### Redirect all old URLs to the new permalink
15
29
 
16
30
  The [`jekyll-redirect-from`](https://github.com/jekyll/jekyll-redirect-from) plugin is [available on GitHub pages](https://pages.github.com/versions/) 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.
@@ -31,6 +31,10 @@ module Jekyll
31
31
  frontmatter = SafeYAML.load(Regexp.last_match(1))
32
32
  end
33
33
 
34
+ if frontmatter.nil?
35
+ frontmatter = frontmatter.to_h
36
+ end
37
+
34
38
  if opts["strategy"] == "retain"
35
39
  frontmatter["permalink"] = post.url
36
40
  else
@@ -1,7 +1,7 @@
1
1
  module Jekyll
2
2
  module Migrate
3
3
  module Permalink
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-migrate-permalink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Chadwick