sigmund_liquid 1.0.11 → 1.0.12

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2M4NWM0MGFjYjE2ZTU4NjFiODYyYTE3MGZkOGQ4OTI0YjdjNmMxOA==
4
+ OTViNTcxM2U2M2M3MDJiNDY4ZmNiNDdhMjVhMzY1NmI4YzczZGViOA==
5
5
  data.tar.gz: !binary |-
6
- NjM5OGEyZTU5NDZmZGRmYjI0Y2I2ZDQwMDFjMjA4ZmE5YjNmNDlmNQ==
6
+ NmY0MTBiZGMwZDNkMjZiMjE4ZDZkNTZhMjYyOWI1MzVhZWIzZjdlYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDAxMmFlMzIyMjFjMjIxNjUxZmRhOThlNGE0ZWRmOWI2NWY1NGYzNDg5YmM0
10
- ZGMxODlkZjAxZjk0MzE5MTNmNzQyNzhhNjZmNmY3ZmQ1ZWY2Njg2ZTIxZmNk
11
- ZTA0ODc5MTA5OTIwYzBlZDE0OWQ5MGY2NTQyZDg2YTViYjU2MTI=
9
+ NGQ4NDNjZDIzNWY4NGFiY2NjNTQ2ZWZkMDJlNzlmZjViMzI2OGY2NDA2OWUy
10
+ YWU2NGUxNTQ4OWI3NGE2YzMzYjM0MmI3YjNiMjI1ODIyNjUxZDE3YzQxYWY2
11
+ ZjEyNjE5ZDY4OWE3ZmJjODM3NzQwYTNlYjg5ZDAwODZkYTJlNGY=
12
12
  data.tar.gz: !binary |-
13
- ZGY4NmE5YmQ3YzY2OTMxOTljMWJhMGQ1MTI3Y2Y4NjkwOTA1ZDI0MjM0MTZl
14
- ZmZjZmRhYWY4NjY2YWEwNDhlNjM5YTE1MzNhNzA3MGMwMmU3ZmFhZjQ4Yzcw
15
- MmNlZjQxYjA3OTY5N2I0Y2I0ZTMzMzQwMDQ5ZmJjZDIxZGNkYjE=
13
+ MWNkNmI0N2MwYTBmMzQ4NTU5ZjIyMTljNTIxODhmN2UyMzExMWMyZTQ0MDQy
14
+ NDNkMmMxNmEyNThiOWFlZTMyNWM1ZjNiODMwN2QzNjQwZTNkNTNmNTkxZTEz
15
+ YjJlZjFlODkyYWRmMDc4ZjY4NzAyMzRmZGUzODkwYjg1MDJjNDE=
@@ -45,11 +45,11 @@ module Sigmund
45
45
  end
46
46
 
47
47
  # Returns a list element, a link to the page and its children
48
- def render_entry_link(context, page, css, depth, is_first, is_last )
48
+ def render_entry_link(context, page, css, depth, is_first, is_last, index )
49
49
  selected = @page.fullpath =~ /^#{page.fullpath}(\/.*)?$/ ? " #{@options[:active_class]}" : ''
50
50
 
51
51
  href = File.join('/', @site.localized_page_fullpath(page))
52
- title = render_title(context, page, href, selected, is_first, is_last)
52
+ title = render_title(context, page, href, selected, is_first, is_last, index)
53
53
 
54
54
  if @options[:liquid_render]
55
55
  return title
@@ -67,18 +67,20 @@ module Sigmund
67
67
  def render_entry_children(context, page, depth)
68
68
  output = %{}
69
69
  children = page.children_with_minimal_attributes.reject { |c| !include_page?(c) }
70
+ i = 0
70
71
  if children.present?
71
72
  children.each do |c, page|
72
73
  css = []
73
74
  css << 'first' if children.first == c
74
75
  css << 'last' if children.last == c
75
- output << render_entry_link(context, c, css.join(' '), depth, children.first == c, children.last == c)
76
+ i = i + 1
77
+ output << render_entry_link(context, c, css.join(' '), depth, children.first == c, children.last == c, i)
76
78
  end
77
79
  end
78
80
  output
79
81
  end
80
82
 
81
- def render_title(context, page, href, selected, is_first, is_last)
83
+ def render_title(context, page, href, selected, is_first, is_last, index)
82
84
  if @options[:liquid_render]
83
85
  context.stack do
84
86
  context['page'] = page
@@ -86,6 +88,7 @@ module Sigmund
86
88
  context['is_last'] = is_last
87
89
  context['href'] = href
88
90
  context['selected'] = selected
91
+ context['index'] = index
89
92
  @options[:liquid_render].render(context)
90
93
  end
91
94
  else
@@ -1,5 +1,5 @@
1
1
  module Sigmund
2
2
  module Liquid
3
- VERSION = "1.0.11"
3
+ VERSION = "1.0.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sigmund_liquid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - amainguy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-28 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler