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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d22a1ca4917467d42824ea2e14897d5363c2ee0
|
|
4
|
+
data.tar.gz: 842dd4a5bb0566dc38ee3992c5fa9d54f525d8a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98b50da2deb75812c4eca533bc3f36a134a30bef95ec3383426cac4425088d46b9f40060ca5ea2cb96a0c945f2e27940767fefc8cbb334e0cdac8f649a63262a
|
|
7
|
+
data.tar.gz: b6ec72cfb505018092ebdd2fbcca1e85aae267ff221bb0b221d8348740a63530d6ad7ad914b6cf150be9e960afaa740fb9b586f78ff2150cdd3e295983ba7365
|
|
@@ -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
|
|
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
|
|
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.
|
|
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-
|
|
11
|
+
date: 2017-10-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|