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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll/fm.rb +16 -14
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 969f1c72f9c3aaae1d9c7ea82cccd76ea40f040f
4
- data.tar.gz: d9c206603d197716e0bd9af57e53372f722f1d6f
3
+ metadata.gz: fbd2117504a7fbd90c93c247d0d9659e52ff521b
4
+ data.tar.gz: cbb55f666f69dd7f082195ed3c2cbf4245d5c339
5
5
  SHA512:
6
- metadata.gz: 2ab1a8b484e630449154a6a46e6c2503c1a3292eaeed711e179bc387d7faee50f3c26f9bbac8973cbb04fce9bb04e96e1f5696e136064b34742fc12a955d52cd
7
- data.tar.gz: ee990fb2f1952b10c8116f9b5c0c7da0dda1161477c06d0f143558c19eef17b8250fa87315f92adfc14acc1cdd1a4542daaf28195f2c7d9628ce21bce0cbaba2
6
+ metadata.gz: ca92a3707d4b4ff4b6aba937227411f0752e98046a325bab1a93dbf0a048310f893e1e85b82b4a9ab43b8f066fe02989f6ff523e54a92cad7ec7cdf46921ffd8
7
+ data.tar.gz: 17d2e07ff05fd2473c948484a1f1b2b0ea693d6ceb10ffc363b415dbebf74f77fe360e14b57be69a791162c13c87f96e75af87806630e84f9d00379e1d257959
@@ -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
- # file = FrontMatterParser::Parser.parse_file(file_path)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-fm
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - A E