jekyll-menus 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 112ca0fd0d0030fd3bcb7b6d7f945fe52f36a8cf
4
- data.tar.gz: 4ec95edef9cacf10e9671babc3e5007ea28fba9b
3
+ metadata.gz: 9857598b8220c0edd8d1dcf67b6452480f71310f
4
+ data.tar.gz: a72b862239c693afd8b6d28d928c45ea368d0737
5
5
  SHA512:
6
- metadata.gz: 4dd4067ac10a03c54a8be8966d9b8ca4592ac0544b05c6627f239ae08bab9b582d377733471e0acfb88c52aa2bd41664e1c357f605013734efa4a09b587699e8
7
- data.tar.gz: 55ce626ee70a53eb6b4e28c6f208894c9c1ce4d9dfbb39b41c74bda11660fa9373bb3def5bb4d1562c4668ac59843990989a9daf997dee20b65565307347bc34
6
+ metadata.gz: d0337c7462c70ef80160995ff03ea2fe75c344d306eeaa313674a8f528582bee552d98f6759d3df8892a7c688f87da72926e1de6610b6ba14bac6396ed3c16bd
7
+ data.tar.gz: a964078532e50ce39446c318193f6263363e0739ebeed5f5d13c17b49a804dd9826c3be688493447394166b6e069e3eb953ea79519282422eaa5b84fcf9796aa
data/lib/jekyll/menus.rb CHANGED
@@ -15,33 +15,34 @@ module Jekyll
15
15
 
16
16
  def to_liquid_drop
17
17
  Drops::All.new(Utils.deep_merge(
18
- _config_menus, _page_menus
18
+ _data_menus, _page_menus
19
19
  ))
20
20
  end
21
21
 
22
22
  #
23
23
 
24
- def _config_menus
25
- mns = [@site.data["menu"], @site.data["menus"]]
26
- out = {}; mns.compact.each do |menus|
27
- menus.each do |key, menu|
28
- if menu.is_a?(Hash) || menu.is_a?(Array)
29
- (menu = [menu].flatten).each do |item|
30
- _validate_config_menu_item(
31
- item
32
- )
33
- end
24
+ def _data_menus
25
+ out = {}
34
26
 
35
- else
36
- _throw_invalid_menu_entry(
37
- menu
27
+ @site.data["menus"].each do |key, menu|
28
+ if menu.is_a?(Hash) || menu.is_a?(Array)
29
+ (menu = [menu].flatten).each do |item|
30
+ _validate_config_menu_item(
31
+ item
38
32
  )
39
33
  end
40
34
 
41
- out = Utils.deep_merge(out, {
42
- key => menu
43
- })
35
+ else
36
+ _throw_invalid_menu_entry(
37
+ menu
38
+ )
44
39
  end
40
+
41
+ merge = { key => menu }
42
+ merge["_fronmatter"] = false
43
+ out = Utils.deep_merge(
44
+ out, merge
45
+ )
45
46
  end
46
47
 
47
48
  out
@@ -157,8 +158,9 @@ module Jekyll
157
158
  val ||= {}
158
159
 
159
160
  val["url"] ||= page.url
160
- val["title"] ||= page.data["title"]
161
161
  val["identifier"] ||= File.basename(page.name, page.ext)
162
+ val["title"] ||= page.data["title"]
163
+ val["_frontmatter"] = true
162
164
  val["weight"] ||= -1
163
165
  val
164
166
  end
@@ -4,6 +4,6 @@
4
4
 
5
5
  module Jekyll
6
6
  class Menus
7
- VERSION = "0.0.2"
7
+ VERSION = "0.0.3"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-menus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordon Bedwell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll