Method: MiddlemanMdocs::Navigation#link_to_tag
- Defined in:
- lib/middleman-mdocs/navigation.rb
#link_to_tag(tag, *args, &block) ⇒ Object
73 74 75 76 77 78 79 80 81 |
# File 'lib/middleman-mdocs/navigation.rb', line 73 def link_to_tag(tag, *args, &block) raise "There no tag #{tag.inspect} defined in mdocs" if tag && !mdocs.has_tag?(tag) if block_given? link_to("/tags/#{tag}", *args, &block) else link_to(I18n.t(tag, scope: %i[mdocs tags], default: tag.to_s), "/tags/#{tag}", *args, &block) end end |