Module: Locomotive::Steam::Liquid::Tags::Concerns::Path
Constant Summary collapse
- Syntax =
/(#{::Liquid::VariableSignature}+)(\s*,.+)?/o
Instance Method Summary collapse
Instance Method Details
#initialize(tag_name, markup, options) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/locomotive/steam/liquid/tags/concerns/path.rb', line 10 def initialize(tag_name, markup, ) if markup =~ Syntax @handle, = $1, $2 # FIXME: the with option needs a string with quotes. # this is a hack for sites which don't follow the new syntax. () @raw_path_options = () else self.wrong_syntax! end super end |
#render_path(context, &block) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/locomotive/steam/liquid/tags/concerns/path.rb', line 26 def render_path(context, &block) set_vars_from_context(context) # return a drop or model? if page = self.retrieve_page_drop_from_handle # make sure we've got the page/content entry (if templatized) # in the right locale change_page_locale(locale, page) do path = build_fullpath(page) block_given? ? block.call(page, path) : path end else '' # no page found end end |