jekyll-redirect-from 0.8.0 → 0.9.0
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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +20 -3
- data/Gemfile +6 -2
- data/History.markdown +5 -0
- data/README.md +6 -0
- data/lib/jekyll-redirect-from/redirector.rb +5 -4
- data/lib/jekyll-redirect-from/version.rb +1 -1
- data/script/cibuild +3 -1
- data/spec/jekyll_redirect_from/redirector_spec.rb +5 -1
- metadata +2 -3
- data/script/test +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7943ee5168973d4f3fb0dfce3ab6cf477b56957a
|
4
|
+
data.tar.gz: 45499228a22ab06aab61f89f2dc8f33c880987b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2adce00c4d8a716ab5304c76fe146571537afea2e4950fb99bf6c67b7adb514997b52f540198c9fe7bb9aab6935d7e44906ef23f8250a7d99af838d49f84927
|
7
|
+
data.tar.gz: b2c337d536492b2a6b5935aadf9b95ef1893f872fe260d68bdffbf7d0b14d6a31e45d2a896c879f8f4ad7466e697d2a1e48c39f2ade0de1077a1c558aea54f2d
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,9 +1,26 @@
|
|
1
1
|
language: ruby
|
2
|
+
before_script: bundle update
|
3
|
+
script: "script/cibuild"
|
2
4
|
sudo: false
|
3
5
|
cache: bundler
|
6
|
+
|
7
|
+
matrix:
|
8
|
+
include:
|
9
|
+
- # GitHub Pages
|
10
|
+
rvm: 2.1.1
|
11
|
+
env: GH_PAGES=true
|
12
|
+
- # Ruby 1.9
|
13
|
+
rvm: 1.9
|
14
|
+
env: JEKYLL_VERSION=2.0
|
15
|
+
allow_failures:
|
16
|
+
- env: GH_PAGES=true # Jekyll 2.4 will fail tests
|
17
|
+
fast_finish: true
|
18
|
+
|
4
19
|
rvm:
|
20
|
+
- 2.2
|
5
21
|
- 2.1
|
6
22
|
- 2.0
|
7
|
-
|
8
|
-
|
9
|
-
|
23
|
+
env:
|
24
|
+
- ""
|
25
|
+
- JEKYLL_VERSION=3.0
|
26
|
+
- JEKYLL_VERSION=2.0
|
data/Gemfile
CHANGED
data/History.markdown
CHANGED
data/README.md
CHANGED
@@ -11,6 +11,12 @@ Instead of dealing with maintaining those pages for redirection, let
|
|
11
11
|
|
12
12
|
[](https://travis-ci.org/jekyll/jekyll-redirect-from)
|
13
13
|
|
14
|
+
## How it Works
|
15
|
+
|
16
|
+
Redirects are performed by serving an HTML file with an HTTP-REFRESH meta
|
17
|
+
tag which points to your destination. No `.htaccess` file, nginx conf, xml
|
18
|
+
file, or anything else will be generated. It simply creates HTML files.
|
19
|
+
|
14
20
|
## Installation
|
15
21
|
|
16
22
|
Add this line to your application's Gemfile:
|
@@ -4,7 +4,7 @@ module JekyllRedirectFrom
|
|
4
4
|
|
5
5
|
def generate(site)
|
6
6
|
original_pages = site.pages.dup
|
7
|
-
generate_alt_urls(site, site.posts)
|
7
|
+
generate_alt_urls(site, site.posts) if Jekyll::VERSION < '3.0.0'
|
8
8
|
generate_alt_urls(site, original_pages)
|
9
9
|
generate_alt_urls(site, site.docs_to_write)
|
10
10
|
end
|
@@ -38,9 +38,10 @@ module JekyllRedirectFrom
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def is_dynamic_document?(page_or_post)
|
41
|
-
page_or_post.is_a?(Jekyll::
|
42
|
-
page_or_post.is_a?(Jekyll::
|
43
|
-
|
41
|
+
page_or_post.is_a?(Jekyll::Page) ||
|
42
|
+
page_or_post.is_a?(Jekyll::Document) ||
|
43
|
+
(Jekyll::VERSION < '3.0.0' &&
|
44
|
+
page_or_post.is_a?(Jekyll::Post))
|
44
45
|
end
|
45
46
|
|
46
47
|
def has_alt_urls?(page_or_post)
|
data/script/cibuild
CHANGED
@@ -11,7 +11,11 @@ describe JekyllRedirectFrom::Redirector do
|
|
11
11
|
let(:page_with_many_redirect_to) { setup_page("multiple_redirect_tos.md") }
|
12
12
|
|
13
13
|
it "knows if a page or post is requesting a redirect page" do
|
14
|
-
|
14
|
+
if Jekyll::VERSION < '3.0.0'
|
15
|
+
expect(redirector.has_alt_urls?(post_to_redirect)).to be_truthy
|
16
|
+
else
|
17
|
+
skip "Don't need to test posts in Jekyll 3"
|
18
|
+
end
|
15
19
|
end
|
16
20
|
|
17
21
|
it "knows if a document is requesting a redirect page" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-redirect-from
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parker Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -103,7 +103,6 @@ files:
|
|
103
103
|
- script/bootstrap
|
104
104
|
- script/cibuild
|
105
105
|
- script/release
|
106
|
-
- script/test
|
107
106
|
- spec/fixtures/_articles/redirect-me-plz.md
|
108
107
|
- spec/fixtures/_articles/redirect-somewhere-else-plz.html
|
109
108
|
- spec/fixtures/_authors/kansaichris.md
|
data/script/test
DELETED