sigmund_liquid 1.0.4 → 1.0.5

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
- MTZiOWU0OGMwYjdlOTRkYjk1MTcwM2YxYTIzNTliNWY4ZmZlOWM3YQ==
4
+ MmIyMmU2ZTk2MTg1NmI2ZTkzODA3ZmQ3OGMwMjg2N2U0OTM2YTgxNg==
5
5
  data.tar.gz: !binary |-
6
- YjdmYjAyYWUyYzM1ZjFkMGU1N2I5MDllNTFiYmJkNjQ1MzljZGI0Nw==
6
+ OTgxMDE4OTU3NjYyM2EzMTcxMDM3MjNmNjlkY2NmMDlkNzU3Yzc4Mg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODI4MDZlYWYxZWJlZTc4ZTAzZTllYTkzZDU2OTM2M2JiMDJmY2E4NzFiMGU0
10
- NjAxMmRmMDQxNjhjOTg2YmEyY2Q4ZTM1ZTkwODhkOWM5NzAyZjM4ODE2ZDkw
11
- MGU1Mzc3MzY3ZTA1ZThlZTVjODEwODU0MDdlMmMwMmU4ZGRjMmU=
9
+ NWUxM2M3ZjQ5OGFmNTliNTNjZWE3ZjE0YWJkMGU3ZTQzNGExNWM3NTliN2Y5
10
+ YzkzYzQ5ZDkzZTIyMmM4MzM3MWY1ZmFhYzllYjFlZTVmMTQ4ZWY1NjgyYzdm
11
+ MjhlOTA2NTMyZDk3OWI5ZTQ0ZGMzNjc3YWIzYzM1ZDJlMTM4OWM=
12
12
  data.tar.gz: !binary |-
13
- ZjAxMjdjMDE5OTBmZWY4NWVlOWVkMzYyZjRhZGI3YzJhNWY0MGMxNzZkNTRi
14
- NGM2YTIwMGFjOWZhYmQ5YTVkY2RjNzlhNTAzNjE3NGVmZjI0NmY0M2EwNTJl
15
- OTA3MjQ4Y2VlOWZmZDY0NmExNzRkZTM3ODA3NDMxNGIyMzRmZTk=
13
+ YjQ0Y2JiNDUxNDllOWY5MjQxMWZlYmJiYmRiMmVhZjg1YzJkNzE2MzVmYzI4
14
+ NWE5NDJmNWY1ZTViMzhmYjUzNjEzMGVlNGZhMDk0MWFiZDg1NTM3NDZlMWUx
15
+ MmUxZDY3NmY0MDM3MjE1YzI5ODhkY2MzZDczOTU4NjU3YjdhZjg=
@@ -46,13 +46,14 @@ module Sigmund
46
46
  selected = @page.fullpath =~ /^#{page.fullpath}(\/.*)?$/ ? " #{@options[:active_class]}" : ''
47
47
 
48
48
  icon = @options[:icon] ? '<span></span>' : ''
49
- title = render_title(context, page, is_first, is_last)
49
+ href = File.join('/', @site.localized_page_fullpath(page))
50
+ title = render_title(context, page, href, is_first, is_last)
50
51
  if @options[:liquid_render]
51
52
  return title
52
53
  end
53
54
  label = %{#{icon if @options[:icon] != 'after' }#{title}#{icon if @options[:icon] == 'after' }}
54
55
 
55
- href = File.join('/', @site.localized_page_fullpath(page))
56
+
56
57
 
57
58
  output = %{<li id="#{page.slug.to_s.dasherize}-link" class="link#{selected} #{css}">}
58
59
  output << %{<a href="#{href}">#{label}</a>}
@@ -80,13 +81,13 @@ module Sigmund
80
81
  output
81
82
  end
82
83
 
83
- def render_title(context, page, is_first, is_last)
84
+ def render_title(context, page, href, is_first, is_last)
84
85
  if @options[:liquid_render]
85
86
  context.stack do
86
87
  context['page'] = page
87
88
  context['is_first'] = is_first
88
89
  context['is_last'] = is_last
89
- context['href'] = File.join('/', @site.localized_page_fullpath(page))
90
+ context['href'] = href
90
91
  @options[:liquid_render].render(context)
91
92
  end
92
93
  else
@@ -85,14 +85,16 @@ module Sigmund
85
85
  selected = @page.fullpath =~ /^#{page.fullpath}(\/.*)?$/ ? " #{@options[:active_class]}" : ''
86
86
 
87
87
  icon = @options[:icon] ? '<span></span>' : ''
88
- title = render_title(context, page)
88
+
89
+ href = File.join('/', @site.localized_page_fullpath(page))
90
+
91
+ title = render_title(context, page, href)
89
92
  if @options[:liquid_render]
90
93
  return title
91
94
  end
92
95
  label = %{#{icon if @options[:icon] != 'after' }#{title}#{icon if @options[:icon] == 'after' }}
93
96
 
94
97
  link_options = caret = ''
95
- href = File.join('/', @site.localized_page_fullpath(page))
96
98
 
97
99
  if render_children_for_page?(page, depth) && bootstrap?
98
100
  css += ' dropdown'
@@ -133,11 +135,11 @@ module Sigmund
133
135
  output
134
136
  end
135
137
 
136
- def render_title(context, page)
138
+ def render_title(context, page, href)
137
139
  if @options[:liquid_render]
138
140
  context.stack do
139
141
  context['page'] = page
140
- context['href'] = File.join('/', @site.localized_page_fullpath(page))
142
+ context['href'] = href
141
143
  @options[:liquid_render].render(context)
142
144
  end
143
145
  else
@@ -1,5 +1,5 @@
1
1
  module Sigmund
2
2
  module Liquid
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sigmund_liquid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - amainguy