jekyll-babel 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-babel/version.rb +1 -1
- data/lib/jekyll/converters/babel.rb +15 -1
- 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: 8d61610d05c41af19a523fa6d99bed37d2f6c0f3
|
4
|
+
data.tar.gz: 1d3611dee6656c43aa6aff266309a95814483377
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9579219ffa13016c80a9e93c8d5d1a6fa766cc0131739707682c5747333837879a77bb42087919e9de018686f2f225c518158ce85568bf983442fd10b978cb14
|
7
|
+
data.tar.gz: fc6ce3c2b4d1f05bea43eb03d967d73e100b8c1d1eecc03e8b40319d07e23f518c1266a111a796de97dc5a25475064028ce10f33f8e479e1a47b42ee35a6e3a3
|
data/lib/jekyll-babel/version.rb
CHANGED
@@ -4,8 +4,16 @@ module Jekyll
|
|
4
4
|
safe true
|
5
5
|
priority :low
|
6
6
|
|
7
|
+
DEFAULT_CONFIGURATION = {
|
8
|
+
'babel_js_extensions' => 'js, es6, babel, jsx'
|
9
|
+
}
|
10
|
+
|
11
|
+
def initialize(config = {})
|
12
|
+
@config = Jekyll::Utils.deep_merge_hashes(DEFAULT_CONFIGURATION, config)
|
13
|
+
end
|
14
|
+
|
7
15
|
def matches(ext)
|
8
|
-
ext.downcase
|
16
|
+
extname_list.include? ext.downcase
|
9
17
|
end
|
10
18
|
|
11
19
|
def output_ext(ext)
|
@@ -15,6 +23,12 @@ module Jekyll
|
|
15
23
|
def convert(content)
|
16
24
|
::Babel::Transpiler.transform(content)['code']
|
17
25
|
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def extname_list
|
30
|
+
@extname_list ||= @config['babel_js_extensions'].split(',').map { |e| ".#{e.downcase.strip}" }
|
31
|
+
end
|
18
32
|
end
|
19
33
|
end
|
20
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-babel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Kyle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: babel-transpiler
|