Class: Locomotive::Steam::Liquid::Tags::LinkTo
Constant Summary
Concerns::Path::Syntax
Instance Method Summary
collapse
#initialize, #render_path
#change_page_locale
Methods inherited from Hybrid
#find_block_delimiter?, #parse, #render_as_block?
Instance Method Details
#render(context) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/locomotive/steam/liquid/tags/link_to.rb', line 10
def render(context)
render_path(context) do |page, path|
label = label_from_page(page)
if render_as_block?
context.stack do
context.scopes.last['target'] = page
label = super.html_safe
end
end
%{<a href="#{path}">#{label}</a>}
end
end
|
#wrong_syntax! ⇒ Object
25
26
27
|
# File 'lib/locomotive/steam/liquid/tags/link_to.rb', line 25
def wrong_syntax!
raise SyntaxError.new("Syntax Error in 'link_to' - Valid syntax: link_to page_handle, locale es (locale is optional)")
end
|