jekyll-fm 6.0.0 → 7.0.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.
- checksums.yaml +4 -4
- data/lib/jekyll/fm.rb +16 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbd2117504a7fbd90c93c247d0d9659e52ff521b
|
4
|
+
data.tar.gz: cbb55f666f69dd7f082195ed3c2cbf4245d5c339
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca92a3707d4b4ff4b6aba937227411f0752e98046a325bab1a93dbf0a048310f893e1e85b82b4a9ab43b8f066fe02989f6ff523e54a92cad7ec7cdf46921ffd8
|
7
|
+
data.tar.gz: 17d2e07ff05fd2473c948484a1f1b2b0ea693d6ceb10ffc363b415dbebf74f77fe360e14b57be69a791162c13c87f96e75af87806630e84f9d00379e1d257959
|
data/lib/jekyll/fm.rb
CHANGED
@@ -1,24 +1,26 @@
|
|
1
1
|
|
2
|
+
def syntax_from_pathname(pathname)
|
3
|
+
File.extname(pathname)[1..-1].to_sym
|
4
|
+
end
|
5
|
+
|
6
|
+
def parse_file(pathname, syntax_parser: nil, loader: nil)
|
7
|
+
syntax_parser ||= syntax_from_pathname(pathname)
|
8
|
+
loader ||= Loader::Yaml.new
|
9
|
+
File.open(pathname) do |file|
|
10
|
+
new(syntax_parser, loader: loader).call(file.read)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
|
2
15
|
Jekyll::Hooks.register :site, :post_read do |site|
|
3
16
|
# Jekyll::Hooks.register :pages, :post_init do |pages|
|
4
17
|
puts site
|
5
18
|
site.posts.each do |f|
|
6
|
-
puts f.path
|
19
|
+
puts "f.path: #{f.path}"
|
7
20
|
# file_path = File.join("_#{collection}", md_path)
|
8
|
-
|
21
|
+
file = parse_file(file_path)
|
22
|
+
puts "file: #{file}"
|
9
23
|
end
|
10
24
|
# InjectorPlugin::Hola.hi
|
11
25
|
end
|
12
26
|
|
13
|
-
|
14
|
-
# def syntax_from_pathname(pathname)
|
15
|
-
# File.extname(pathname)[1..-1].to_sym
|
16
|
-
# end
|
17
|
-
|
18
|
-
# def parse_file(pathname, syntax_parser: nil, loader: nil)
|
19
|
-
# syntax_parser ||= syntax_from_pathname(pathname)
|
20
|
-
# loader ||= Loader::Yaml.new
|
21
|
-
# File.open(pathname) do |file|
|
22
|
-
# new(syntax_parser, loader: loader).call(file.read)
|
23
|
-
# end
|
24
|
-
# end
|