5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/jekyll/polyglot/liquid/tags/static_href.rb', line 5
def render(context)
text = super
href_attrs = text.strip.split('=', 2)
valid = (href_attrs.length == 2 && href_attrs[0] == 'href') && href_attrs[1].start_with?('"') && href_attrs[1].end_with?('"')
unless valid
raise Liquid::SyntaxError, "static_href parameters must include match href=\"...\" attribute param, eg. href=\"http://example.com, href=\"/about\", href=\"/\" , instead got:\n#{text}"
end
href_value = href_attrs[1]
"ferh=#{href_value}"
end
|