jekyll-relative-links 0.5.0 → 0.5.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: 351e7b664aa98021cf0c3f719ea7e2a0aaaf7895
4
- data.tar.gz: 6ec9d3f4f76991b2ee7757ef2da9394fad71abee
3
+ metadata.gz: 4d22a1ca4917467d42824ea2e14897d5363c2ee0
4
+ data.tar.gz: 842dd4a5bb0566dc38ee3992c5fa9d54f525d8a0
5
5
  SHA512:
6
- metadata.gz: a5ff53c27eee911580d3b66f40da628b5df9ff0f494cc8d246b9c2c1b7bf3f944213df60345f52e755a1d4398d31d5d8985add045c22507c2abfc4feecea1401
7
- data.tar.gz: 7de7fcbb5ad99a925f1254d3195e5ac812a654a35abc5e3b645ed9a94471c6ef418526f12c03469cb91ff8a683455a7e77b13c6c1278e1916c424060f0878805
6
+ metadata.gz: 98b50da2deb75812c4eca533bc3f36a134a30bef95ec3383426cac4425088d46b9f40060ca5ea2cb96a0c945f2e27940767fefc8cbb334e0cdac8f649a63262a
7
+ data.tar.gz: b6ec72cfb505018092ebdd2fbcca1e85aae267ff221bb0b221d8348740a63530d6ad7ad914b6cf150be9e960afaa740fb9b586f78ff2150cdd3e295983ba7365
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "jekyll"
2
4
  require_relative "jekyll-relative-links/generator"
3
5
  require_relative "jekyll-relative-links/context"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JekyllRelativeLinks
2
4
  class Context
3
5
  attr_reader :site
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JekyllRelativeLinks
2
4
  class Generator < Jekyll::Generator
3
5
  attr_accessor :site
@@ -8,7 +10,7 @@ module JekyllRelativeLinks
8
10
  LINK_TEXT_REGEX = %r!([^\]]+)!
9
11
  FRAGMENT_REGEX = %r!(#.+?)?!
10
12
  INLINE_LINK_REGEX = %r!\[#{LINK_TEXT_REGEX}\]\(([^\)]+?)#{FRAGMENT_REGEX}\)!
11
- REFERENCE_LINK_REGEX = %r!^\s*\[#{LINK_TEXT_REGEX}\]: (.+?)#{FRAGMENT_REGEX}$!
13
+ REFERENCE_LINK_REGEX = %r!^\s*?\[#{LINK_TEXT_REGEX}\]: (.+?)#{FRAGMENT_REGEX}\s*?$!
12
14
  LINK_REGEX = %r!(#{INLINE_LINK_REGEX}|#{REFERENCE_LINK_REGEX})!
13
15
  CONVERTER_CLASS = Jekyll::Converters::Markdown
14
16
  CONFIG_KEY = "relative_links".freeze
@@ -33,6 +35,7 @@ module JekyllRelativeLinks
33
35
 
34
36
  documents.each do |document|
35
37
  next unless markdown_extension?(document.extname)
38
+ next if document.is_a?(Jekyll::StaticFile)
36
39
  replace_relative_links!(document)
37
40
  end
38
41
  end
@@ -100,7 +103,7 @@ module JekyllRelativeLinks
100
103
  if type == :inline
101
104
  "[#{text}](#{url})"
102
105
  else
103
- "[#{text}]: #{url}"
106
+ "\n[#{text}]: #{url}"
104
107
  end
105
108
  end
106
109
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JekyllRelativeLinks
2
- VERSION = "0.5.0".freeze
4
+ VERSION = "0.5.1".freeze
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-relative-links
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-11 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll