jekyll-conrefifier 0.4.2 → 0.4.3
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/lib/jekyll-conrefifier.rb +6 -1
- data/lib/version.rb +1 -1
- data/spec/spec_helper.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7059a7736b67f01af3dfb5000cf2c686e98a5abe
|
4
|
+
data.tar.gz: 866a2d9c119d548c5028735df74500f8e57ae429
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32748009a5dcbd176b78dab0349ef649040e333a4005da9300db83720f8c87641a110bb672ce5eaa2589539f22693120d38da074741208e0f516137bdaa7ad27
|
7
|
+
data.tar.gz: 86411b8490361e483925086fccb6be2b49afd579b437890e83af0152d74b612da30f44302971da0194cfa256c8719bfc492b73e3ea5ff0202638f347e04190f8
|
data/lib/jekyll-conrefifier.rb
CHANGED
@@ -29,6 +29,9 @@ module Jekyll
|
|
29
29
|
end
|
30
30
|
|
31
31
|
class Document
|
32
|
+
# remove when on a moderner Jekyll
|
33
|
+
FRONT_REGEXP = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
34
|
+
|
32
35
|
# allow us to use any variable within Jekyll Frontmatter; for example:
|
33
36
|
# title: What are {{ site.data.conrefs.product_name[site.audience] }} Pages?
|
34
37
|
# renders as "GitHub Pages?" for dotcom, but "GitHub Enterprise Pages?" for Enterprise
|
@@ -42,13 +45,15 @@ module Jekyll
|
|
42
45
|
@data = defaults
|
43
46
|
end
|
44
47
|
@content = File.read(path, merged_file_read_opts(opts))
|
45
|
-
if content =~
|
48
|
+
if content =~ FRONT_REGEXP
|
46
49
|
@content = $POSTMATCH
|
47
50
|
prev_match = $1
|
48
51
|
prev_match = prev_match.gsub(/\{\{.+?\}\}/) do |match|
|
49
52
|
data_vars = ConrefifierUtils.setup_config(@site, opts, path)
|
50
53
|
value = ConrefifierUtils.convert(match, data_vars)
|
51
54
|
value = Jekyll::Renderer.new(@site, self).convert(value)
|
55
|
+
value = value.gsub(/:/, ':')
|
56
|
+
value = value.gsub(/\\"/, '"')
|
52
57
|
value.sub(/^<p>/, '').sub(/<\/p>$/, '').strip
|
53
58
|
end
|
54
59
|
|
data/lib/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
require "jekyll"
|
2
2
|
require File.expand_path("lib/jekyll-conrefifier.rb")
|
3
3
|
|
4
|
-
Jekyll::Document::YAML_FRONT_MATTER_REGEXP = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
5
|
-
|
6
4
|
RSpec.configure do |config|
|
7
5
|
config.run_all_when_everything_filtered = true
|
8
6
|
config.filter_run :focus
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-conrefifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen J. Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|