jekyll-redirect-from 0.16.0 → 0.17.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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/History.markdown +22 -0
  3. data/README.md +11 -6
  4. data/lib/jekyll-redirect-from/generator.rb +6 -0
  5. data/lib/jekyll-redirect-from/redirect.html +4 -4
  6. data/lib/jekyll-redirect-from/redirect_page.rb +47 -2
  7. data/lib/jekyll-redirect-from/redirectable.rb +4 -10
  8. data/lib/jekyll-redirect-from/version.rb +1 -1
  9. metadata +9 -64
  10. data/.gitignore +0 -20
  11. data/.rspec +0 -4
  12. data/.rubocop.yml +0 -11
  13. data/.rubocop_todo.yml +0 -40
  14. data/.travis.yml +0 -20
  15. data/Gemfile +0 -7
  16. data/Rakefile +0 -8
  17. data/jekyll-redirect-from.gemspec +0 -34
  18. data/script/bootstrap +0 -4
  19. data/script/cibuild +0 -6
  20. data/script/fmt +0 -10
  21. data/script/release +0 -4
  22. data/script/test +0 -2
  23. data/spec/fixtures/_articles/redirect-me-plz.md +0 -6
  24. data/spec/fixtures/_articles/redirect-somewhere-else-im-a-permalink.html +0 -7
  25. data/spec/fixtures/_articles/redirect-somewhere-else-plz.html +0 -6
  26. data/spec/fixtures/_authors/kansaichris.md +0 -5
  27. data/spec/fixtures/_layouts/layout.html +0 -6
  28. data/spec/fixtures/_posts/2014-01-03-redirect-me-plz.md +0 -6
  29. data/spec/fixtures/multiple_redirect_froms.md +0 -10
  30. data/spec/fixtures/multiple_redirect_tos.md +0 -9
  31. data/spec/fixtures/one_redirect_from.md +0 -6
  32. data/spec/fixtures/one_redirect_to_path.md +0 -6
  33. data/spec/fixtures/one_redirect_to_url.md +0 -6
  34. data/spec/fixtures/tags/how we work.md +0 -4
  35. data/spec/integrations_spec.rb +0 -88
  36. data/spec/jekyll_redirect_from/context_spec.rb +0 -14
  37. data/spec/jekyll_redirect_from/generator_spec.rb +0 -171
  38. data/spec/jekyll_redirect_from/layout_spec.rb +0 -34
  39. data/spec/jekyll_redirect_from/redirect_page_spec.rb +0 -211
  40. data/spec/jekyll_redirect_from/redirectable_spec.rb +0 -63
  41. data/spec/spec_helper.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aaa57b2c808238484878ca1bf88007e53d33913ebaf9dd17d8f8adbfa306c49a
4
- data.tar.gz: 82bf36aaf666d402f9d0c8058cfd92b77bfb15170de288cb82d0eddc2b512c90
3
+ metadata.gz: af230f353ff0028f5807c5102758c88555cf7b59c5470945735c08f028095bf9
4
+ data.tar.gz: 9f952f13442476655497f5157092e0d486fb40dce5f3f7fe5e8b55444cc8a97f
5
5
  SHA512:
6
- metadata.gz: 2482574aba0bf20ebee0a17757a0bd1f967bfb70c0ddd0a8a4168d7da2105e7bf6763528ff15bdb1aca90ae7bfc068dc222ea4f1918e005f2805743d891f0cb1
7
- data.tar.gz: 57dda6d4f263907a82f17baa9b9657cf33343c3f941f033c56563c8cf6f698445f4f691254422a59f948dc0b384b1a91d78e0b17106feb664a5393c95b23587a
6
+ metadata.gz: a0eea2e2e0693456d3f0daef22c5e5e570cb835b29c56065d0dfce7be795fdac054e4773015ab9aeeb861ea1189e0b37a6f0bc9abfc6013dc70891b7eeba0c84
7
+ data.tar.gz: 042e3e684eff1c467f825915f5c4d4c055367fc8e22e2e250243089aec1643c09d0160ecfc699a41b37893497c3d0ebb9e6b78f2adbd02f2194a2df861b49cfa
data/History.markdown CHANGED
@@ -1,3 +1,25 @@
1
+ ## 0.17.0 / 2026-09-29
2
+
3
+ ### Security
4
+
5
+ * Only allow http(s) and relative `redirect_to` targets, percent-encode unsafe characters in them, and escape them in the redirect page (GHSA-xfg6-hjrc-hpvx)
6
+
7
+ ### styles
8
+
9
+ * style: Style/SpecialGlobalVars (#216)
10
+
11
+ ### Development Fixes
12
+
13
+ * fix Gemfile to correctly install jekyll 3.9 (#224)
14
+ * Refactor specs for RedirectPage (#222)
15
+ * Lock to RuboCop v1.18.x (#242)
16
+ * Clean up gemspec (#243)
17
+ * Bump versions in CI workflow (#273)
18
+
19
+ ### Bug Fixes
20
+
21
+ * Refactor Redirectable mixin to reduce allocations (#241)
22
+
1
23
  ## 0.16.0 / 2020-01-26
2
24
 
3
25
  ### Minor Enhancements
data/README.md CHANGED
@@ -9,7 +9,7 @@ impractical to create new pages in the proper subdirectories so they, e.g.
9
9
  Instead of dealing with maintaining those pages for redirection, let
10
10
  `jekyll-redirect-from` handle it for you.
11
11
 
12
- [![Build Status](https://travis-ci.org/jekyll/jekyll-redirect-from.svg?branch=master)](https://travis-ci.org/jekyll/jekyll-redirect-from)
12
+ [![Build Status](https://github.com/jekyll/jekyll-redirect-from/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jekyll/jekyll-redirect-from/actions/workflows/ci.yml)
13
13
 
14
14
  ## How it Works
15
15
 
@@ -31,7 +31,7 @@ Or install it yourself as:
31
31
 
32
32
  $ gem install jekyll-redirect-from
33
33
 
34
- Once it's installed into your evironment, add it to your `_config.yml`:
34
+ Once it's installed into your environment, add it to your `_config.yml`:
35
35
 
36
36
  ```yaml
37
37
  plugins:
@@ -52,7 +52,7 @@ Then run `jekyll <cmd> --safe` like normal.
52
52
 
53
53
  ## Usage
54
54
 
55
- The object of this gem is to allow an author to specify multiple URLs for a
55
+ The objective of this gem is to allow an author to specify multiple URLs for a
56
56
  page, such that the alternative URLs redirect to the new Jekyll URL.
57
57
 
58
58
  To use it, simply add the array to the YAML front-matter of your page or post:
@@ -68,7 +68,7 @@ Redirects including a trailing slash will generate a corresponding subdirectory
68
68
 
69
69
  For example...
70
70
 
71
- ```text
71
+ ```yaml
72
72
  redirect_from:
73
73
  - /post/123456789/my-amazing-post
74
74
  ```
@@ -81,7 +81,7 @@ redirect_from:
81
81
 
82
82
  While...
83
83
 
84
- ```text
84
+ ```yaml
85
85
  redirect_from:
86
86
  - /post/123456789/my-amazing-post/
87
87
  ```
@@ -96,7 +96,7 @@ These pages will contain an HTTP-REFRESH meta tag which redirect to your URL.
96
96
 
97
97
  You can also specify just **one url** like this:
98
98
 
99
- ```text
99
+ ```yaml
100
100
  title: My other awesome post
101
101
  redirect_from: /post/123456798/
102
102
  ```
@@ -126,6 +126,11 @@ Your layout will get the following variables:
126
126
 
127
127
  * `page.redirect.from` - the relative path to the redirect page
128
128
  * `page.redirect.to` - the absolute URL (where available) to the target page
129
+ * `page.redirect.to_js` - `page.redirect.to` as a quoted JavaScript string literal, safe to use inside a `<script>` element
130
+
131
+ Characters that could break out of HTML or JavaScript (quotes, angle brackets, backslashes, backticks, curly braces, whitespace and control characters) are percent-encoded in `page.redirect.to`, so a custom layout that outputs it without escaping is still safe. Using the `escape` filter in HTML attributes (e.g. `{{ page.redirect.to | escape }}`) and `page.redirect.to_js` in scripts is still recommended.
132
+
133
+ `redirect_to` must be a relative path or an `http://` or `https://` URL. Other schemes, such as `javascript:`, are ignored and a warning is logged.
129
134
 
130
135
  ## Configuration
131
136
 
@@ -39,6 +39,12 @@ module JekyllRedirectFrom
39
39
  def generate_redirect_to(doc)
40
40
  return unless doc.redirect_to
41
41
 
42
+ unless RedirectPage.valid_target?(doc.redirect_to)
43
+ Jekyll.logger.warn "Redirect from:", "Ignoring disallowed redirect_to " \
44
+ "#{doc.redirect_to.inspect} in #{doc.relative_path}"
45
+ return
46
+ end
47
+
42
48
  page = RedirectPage.redirect_to(doc, doc.redirect_to)
43
49
  doc.data.merge!(page.data)
44
50
  doc.content = doc.output = page.output
@@ -2,10 +2,10 @@
2
2
  <html lang="en-US">
3
3
  <meta charset="utf-8">
4
4
  <title>Redirecting&hellip;</title>
5
- <link rel="canonical" href="{{ page.redirect.to }}">
6
- <script>location="{{ page.redirect.to }}"</script>
7
- <meta http-equiv="refresh" content="0; url={{ page.redirect.to }}">
5
+ <link rel="canonical" href="{{ page.redirect.to | escape }}">
6
+ <script>location={{ page.redirect.to_js }}</script>
7
+ <meta http-equiv="refresh" content="0; url={{ page.redirect.to | escape }}">
8
8
  <meta name="robots" content="noindex">
9
9
  <h1>Redirecting&hellip;</h1>
10
- <a href="{{ page.redirect.to }}">Click here if you are not redirected.</a>
10
+ <a href="{{ page.redirect.to | escape }}">Click here if you are not redirected.</a>
11
11
  </html>
@@ -11,6 +11,34 @@ module JekyllRedirectFrom
11
11
  "layout" => "redirect",
12
12
  }.freeze
13
13
 
14
+ # Schemes which may be used for an absolute redirect target. Anything else
15
+ # (e.g. `javascript:` or `data:`) could execute script on the redirect page.
16
+ ALLOWED_SCHEMES = %w(http https).freeze
17
+
18
+ # Browsers ignore leading and trailing C0 control characters and spaces, and
19
+ # tabs and newlines anywhere in a URL, when determining its scheme.
20
+ URL_STRIP_REGEX = %r![\t\n\r]!.freeze
21
+ URL_TRIM_REGEX = %r!\A[\u0000-\u0020]+|[\u0000-\u0020]+\z!.freeze
22
+ SCHEME_REGEX = %r!\A([a-z][a-z0-9+\-.]*):!i.freeze
23
+
24
+ # Characters which are never valid unencoded in a URL and could break out
25
+ # of an HTML attribute or a JavaScript string if the target is output raw
26
+ # (e.g. by a custom redirect layout): quotes, angle brackets, backslash,
27
+ # backtick, curly braces (JavaScript template literal interpolation),
28
+ # whitespace, C0 control characters and DEL.
29
+ UNSAFE_URL_CHARS_REGEX = %r![\s"'<>\\`{}\x00-\x1F\x7F]!.freeze
30
+
31
+ # Characters which must be escaped for a JSON string to be safely embedded
32
+ # in an HTML <script> element.
33
+ JS_ESCAPE_REGEX = %r![<>&\u2028\u2029]!.freeze
34
+
35
+ # Returns true if the given target is a relative path or an http(s) URL
36
+ def self.valid_target?(to)
37
+ normalized = to.to_s.gsub(URL_STRIP_REGEX, "").gsub(URL_TRIM_REGEX, "")
38
+ scheme = normalized[SCHEME_REGEX, 1]
39
+ scheme.nil? || ALLOWED_SCHEMES.include?(scheme.downcase)
40
+ end
41
+
14
42
  # Creates a new RedirectPage instance from a source path and redirect path
15
43
  #
16
44
  # site - The Site object
@@ -43,13 +71,20 @@ module JekyllRedirectFrom
43
71
  # from - the relative path to the redirect page
44
72
  # to - the relative path or absolute URL to the redirect target
45
73
  def set_paths(from, to)
74
+ unless self.class.valid_target?(to)
75
+ raise ArgumentError, "Disallowed redirect target: #{to.inspect}"
76
+ end
77
+
46
78
  @context ||= context
47
79
  from = ensure_leading_slash(from)
80
+ to = %r!^https?://!.match?(to) ? to : absolute_url(to)
81
+ to = encode_unsafe_chars(to)
48
82
  data.merge!(
49
83
  "permalink" => from,
50
84
  "redirect" => {
51
- "from" => from,
52
- "to" => %r!^https?://!.match?(to) ? to : absolute_url(to),
85
+ "from" => from,
86
+ "to" => to,
87
+ "to_js" => js_escape(to.to_json),
53
88
  }
54
89
  )
55
90
  end
@@ -64,6 +99,16 @@ module JekyllRedirectFrom
64
99
 
65
100
  private
66
101
 
102
+ def encode_unsafe_chars(url)
103
+ url.to_s.gsub(UNSAFE_URL_CHARS_REGEX) do |char|
104
+ char.bytes.map { |byte| format("%%%02X", byte) }.join
105
+ end
106
+ end
107
+
108
+ def js_escape(json)
109
+ json.gsub(JS_ESCAPE_REGEX) { |char| format("\\u%04x", char.ord) }
110
+ end
111
+
67
112
  def context
68
113
  JekyllRedirectFrom::Context.new(site)
69
114
  end
@@ -7,21 +7,15 @@ module JekyllRedirectFrom
7
7
  # Returns a string representing the relative path or URL
8
8
  # to which the document should be redirected
9
9
  def redirect_to
10
- if to_liquid["redirect_to"].is_a?(Array)
11
- to_liquid["redirect_to"].compact.first
12
- else
13
- to_liquid["redirect_to"]
14
- end
10
+ meta_data = to_liquid["redirect_to"]
11
+ meta_data.is_a?(Array) ? meta_data.compact.first : meta_data
15
12
  end
16
13
 
17
14
  # Returns an array representing the relative paths to other
18
15
  # documents which should be redirected to this document
19
16
  def redirect_from
20
- if to_liquid["redirect_from"].is_a?(Array)
21
- to_liquid["redirect_from"].compact
22
- else
23
- [to_liquid["redirect_from"]].compact
24
- end
17
+ meta_data = to_liquid["redirect_from"]
18
+ meta_data.is_a?(Array) ? meta_data.compact : [meta_data].compact
25
19
  end
26
20
  end
27
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllRedirectFrom
4
- VERSION = "0.16.0"
4
+ VERSION = "0.17.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-redirect-from
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2020-01-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: jekyll
@@ -64,14 +63,14 @@ dependencies:
64
63
  requirements:
65
64
  - - "~>"
66
65
  - !ruby/object:Gem::Version
67
- version: '12.0'
66
+ version: '13.0'
68
67
  type: :development
69
68
  prerelease: false
70
69
  version_requirements: !ruby/object:Gem::Requirement
71
70
  requirements:
72
71
  - - "~>"
73
72
  - !ruby/object:Gem::Version
74
- version: '12.0'
73
+ version: '13.0'
75
74
  - !ruby/object:Gem::Dependency
76
75
  name: rspec
77
76
  requirement: !ruby/object:Gem::Requirement
@@ -92,32 +91,23 @@ dependencies:
92
91
  requirements:
93
92
  - - "~>"
94
93
  - !ruby/object:Gem::Version
95
- version: '0.10'
94
+ version: 0.13.0
96
95
  type: :development
97
96
  prerelease: false
98
97
  version_requirements: !ruby/object:Gem::Requirement
99
98
  requirements:
100
99
  - - "~>"
101
100
  - !ruby/object:Gem::Version
102
- version: '0.10'
103
- description:
101
+ version: 0.13.0
104
102
  email:
105
103
  - parkrmoore@gmail.com
106
104
  executables: []
107
105
  extensions: []
108
106
  extra_rdoc_files: []
109
107
  files:
110
- - ".gitignore"
111
- - ".rspec"
112
- - ".rubocop.yml"
113
- - ".rubocop_todo.yml"
114
- - ".travis.yml"
115
- - Gemfile
116
108
  - History.markdown
117
109
  - LICENSE.txt
118
110
  - README.md
119
- - Rakefile
120
- - jekyll-redirect-from.gemspec
121
111
  - lib/jekyll-redirect-from.rb
122
112
  - lib/jekyll-redirect-from/context.rb
123
113
  - lib/jekyll-redirect-from/generator.rb
@@ -127,35 +117,10 @@ files:
127
117
  - lib/jekyll-redirect-from/redirect_page.rb
128
118
  - lib/jekyll-redirect-from/redirectable.rb
129
119
  - lib/jekyll-redirect-from/version.rb
130
- - script/bootstrap
131
- - script/cibuild
132
- - script/fmt
133
- - script/release
134
- - script/test
135
- - spec/fixtures/_articles/redirect-me-plz.md
136
- - spec/fixtures/_articles/redirect-somewhere-else-im-a-permalink.html
137
- - spec/fixtures/_articles/redirect-somewhere-else-plz.html
138
- - spec/fixtures/_authors/kansaichris.md
139
- - spec/fixtures/_layouts/layout.html
140
- - spec/fixtures/_posts/2014-01-03-redirect-me-plz.md
141
- - spec/fixtures/multiple_redirect_froms.md
142
- - spec/fixtures/multiple_redirect_tos.md
143
- - spec/fixtures/one_redirect_from.md
144
- - spec/fixtures/one_redirect_to_path.md
145
- - spec/fixtures/one_redirect_to_url.md
146
- - spec/fixtures/tags/how we work.md
147
- - spec/integrations_spec.rb
148
- - spec/jekyll_redirect_from/context_spec.rb
149
- - spec/jekyll_redirect_from/generator_spec.rb
150
- - spec/jekyll_redirect_from/layout_spec.rb
151
- - spec/jekyll_redirect_from/redirect_page_spec.rb
152
- - spec/jekyll_redirect_from/redirectable_spec.rb
153
- - spec/spec_helper.rb
154
120
  homepage: https://github.com/jekyll/jekyll-redirect-from
155
121
  licenses:
156
122
  - MIT
157
123
  metadata: {}
158
- post_install_message:
159
124
  rdoc_options: []
160
125
  require_paths:
161
126
  - lib
@@ -163,34 +128,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
128
  requirements:
164
129
  - - ">="
165
130
  - !ruby/object:Gem::Version
166
- version: 2.4.0
131
+ version: 2.5.0
167
132
  required_rubygems_version: !ruby/object:Gem::Requirement
168
133
  requirements:
169
134
  - - ">="
170
135
  - !ruby/object:Gem::Version
171
136
  version: '0'
172
137
  requirements: []
173
- rubygems_version: 3.0.6
174
- signing_key:
138
+ rubygems_version: 3.6.9
175
139
  specification_version: 4
176
140
  summary: Seamlessly specify multiple redirection URLs for your pages and posts
177
- test_files:
178
- - spec/fixtures/_articles/redirect-me-plz.md
179
- - spec/fixtures/_articles/redirect-somewhere-else-im-a-permalink.html
180
- - spec/fixtures/_articles/redirect-somewhere-else-plz.html
181
- - spec/fixtures/_authors/kansaichris.md
182
- - spec/fixtures/_layouts/layout.html
183
- - spec/fixtures/_posts/2014-01-03-redirect-me-plz.md
184
- - spec/fixtures/multiple_redirect_froms.md
185
- - spec/fixtures/multiple_redirect_tos.md
186
- - spec/fixtures/one_redirect_from.md
187
- - spec/fixtures/one_redirect_to_path.md
188
- - spec/fixtures/one_redirect_to_url.md
189
- - spec/fixtures/tags/how we work.md
190
- - spec/integrations_spec.rb
191
- - spec/jekyll_redirect_from/context_spec.rb
192
- - spec/jekyll_redirect_from/generator_spec.rb
193
- - spec/jekyll_redirect_from/layout_spec.rb
194
- - spec/jekyll_redirect_from/redirect_page_spec.rb
195
- - spec/jekyll_redirect_from/redirectable_spec.rb
196
- - spec/spec_helper.rb
141
+ test_files: []
data/.gitignore DELETED
@@ -1,20 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- spec/fixtures/.jekyll-metadata
16
- spec/fixtures/.jekyll-cache
17
- test/tmp
18
- test/version_tmp
19
- tmp
20
- vendor/bundle
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --color
2
- --format progress
3
- --require spec_helper
4
- --order random
data/.rubocop.yml DELETED
@@ -1,11 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- require: rubocop-jekyll
4
-
5
- inherit_gem:
6
- rubocop-jekyll: .rubocop.yml
7
-
8
- AllCops:
9
- TargetRubyVersion: 2.4
10
- Exclude:
11
- - vendor/**/*
data/.rubocop_todo.yml DELETED
@@ -1,40 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2018-12-06 11:51:19 +0100 using RuboCop version 0.61.1.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 12
10
- # Configuration parameters: CountComments, Max, ExcludedMethods.
11
- # ExcludedMethods: refine
12
- Metrics/BlockLength:
13
- Exclude:
14
- - 'spec/integrations_spec.rb'
15
- - 'spec/jekyll_redirect_from/generator_spec.rb'
16
- - 'spec/jekyll_redirect_from/redirect_page_spec.rb'
17
- - 'spec/jekyll_redirect_from/redirectable_spec.rb'
18
- - 'spec/spec_helper.rb'
19
-
20
- # Offense count: 3
21
- # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
22
- # URISchemes: http, https
23
- Metrics/LineLength:
24
- Exclude:
25
- - 'spec/jekyll_redirect_from/generator_spec.rb'
26
- - 'spec/jekyll_redirect_from/redirect_page_spec.rb'
27
-
28
- # Offense count: 1
29
- # Configuration parameters: EnforcedStyleForLeadingUnderscores.
30
- # SupportedStylesForLeadingUnderscores: disallowed, required, optional
31
- Naming/MemoizedInstanceVariableName:
32
- Exclude:
33
- - 'lib/jekyll-redirect-from/page_without_a_file.rb'
34
-
35
- # Offense count: 2
36
- # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
37
- # AllowedNames: io, id, to, by, on, in, at, ip, db
38
- Naming/UncommunicativeMethodParamName:
39
- Exclude:
40
- - 'lib/jekyll-redirect-from/redirect_page.rb'
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - &latest_ruby 2.6
5
- - 2.4
6
- - 2.3
7
- env:
8
- - JEKYLL_VERSION="~> 3.8"
9
- matrix:
10
- include:
11
- - # GitHub Pages
12
- rvm: 2.5.3
13
- env: GH_PAGES=true
14
- - rvm: *latest_ruby
15
- env: JEKYLL_VERSION="~> 4.0"
16
-
17
- before_install:
18
- - gem update --system
19
- before_script: bundle update
20
- script: script/cibuild
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
- gemspec
5
-
6
- gem "github-pages" if ENV["GH_PAGES"]
7
- gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task :default => :spec
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path("lib", __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "jekyll-redirect-from/version"
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "jekyll-redirect-from"
9
- spec.version = JekyllRedirectFrom::VERSION
10
- spec.authors = ["Parker Moore"]
11
- spec.email = ["parkrmoore@gmail.com"]
12
- spec.summary = "Seamlessly specify multiple redirection URLs " \
13
- "for your pages and posts"
14
- spec.homepage = "https://github.com/jekyll/jekyll-redirect-from"
15
- spec.license = "MIT"
16
-
17
- # rubocop:disable Style/SpecialGlobalVars
18
- spec.files = `git ls-files`.split($/)
19
- # rubocop:enable Style/SpecialGlobalVars
20
-
21
- spec.executables = spec.files.grep(%r!^bin/!) { |f| File.basename(f) }
22
- spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
23
- spec.require_paths = ["lib"]
24
-
25
- spec.required_ruby_version = ">= 2.4.0"
26
-
27
- spec.add_runtime_dependency "jekyll", ">= 3.3", "< 5.0"
28
-
29
- spec.add_development_dependency "bundler"
30
- spec.add_development_dependency "jekyll-sitemap", "~> 1.0"
31
- spec.add_development_dependency "rake", "~> 12.0"
32
- spec.add_development_dependency "rspec", "~> 3.5"
33
- spec.add_development_dependency "rubocop-jekyll", "~> 0.10"
34
- end
data/script/bootstrap DELETED
@@ -1,4 +0,0 @@
1
- #! /bin/bash
2
- set -e
3
-
4
- bundle install -j8 || bundle install
data/script/cibuild DELETED
@@ -1,6 +0,0 @@
1
- #! /bin/bash
2
- set -e
3
-
4
- script/test
5
- script/fmt
6
- bundle exec rake build
data/script/fmt DELETED
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- echo "Rubocop $(bundle exec rubocop --version)"
5
- bundle exec rubocop -D -E $@
6
- success=$?
7
- if ((success != 0)); then
8
- echo -e "\nTry running \`script/fmt -a\` to automatically fix errors"
9
- fi
10
- exit $success
data/script/release DELETED
@@ -1,4 +0,0 @@
1
- #! /bin/bash
2
-
3
- script/cibuild
4
- bundle exec rake release
data/script/test DELETED
@@ -1,2 +0,0 @@
1
- #!/bin/sh
2
- bundle exec rspec $@
@@ -1,6 +0,0 @@
1
- ---
2
- title: Please redirect me, sir.
3
- redirect_from: /articles/23128432159832/mary-had-a-little-lamb
4
- ---
5
-
6
- Yay.
@@ -1,7 +0,0 @@
1
- ---
2
- title: Please redirect away from me and my permalink.
3
- permalink: /tags/our projects/
4
- redirect_to: /tags/our-projects/
5
- ---
6
-
7
- Bye.
@@ -1,6 +0,0 @@
1
- ---
2
- title: Please redirect away from me, sir.
3
- redirect_to: "http://www.zombo.com"
4
- ---
5
-
6
- Boo.
@@ -1,5 +0,0 @@
1
- ---
2
- redirect_from: /kansaichris/
3
- ---
4
-
5
- Hi.
@@ -1,6 +0,0 @@
1
- ---
2
- ---
3
-
4
- LAYOUT INCLUDED
5
-
6
- {{ content }}
@@ -1,6 +0,0 @@
1
- ---
2
- title: Please redirect me, sir.
3
- redirect_from: /posts/23128432159832/mary-had-a-little-lamb
4
- ---
5
-
6
- Yay.
@@ -1,10 +0,0 @@
1
- ---
2
- title: I have lots of redirect urls
3
- redirect_from:
4
- - help
5
- - contact
6
- - let-there/be/light-he-said
7
- - /geepers/mccreepin
8
- ---
9
-
10
- Lots of redirect urls
@@ -1,9 +0,0 @@
1
- ---
2
- title: I have lots of redirect to urls
3
- redirect_to:
4
- - https://www.jekyllrb.com
5
- - https://www.github.com
6
- - https://www.twitter.com
7
- ---
8
-
9
- Lots of redirect to urls.
@@ -1,6 +0,0 @@
1
- ---
2
- title: I only have one redirect path
3
- redirect_from: some/other/path
4
- ---
5
-
6
- One redirect url
@@ -1,6 +0,0 @@
1
- ---
2
- title: I am going somewhere external
3
- redirect_to: /foo
4
- ---
5
-
6
- Redirecting elsewhere.