Sha256: e4a4ab92ab0a2a6e9e2235a60f37a1fe8e0c66e29b53bed0db84349d711ed674
Contents?: true
Size: 737 Bytes
Versions: 2
Compression:
Stored size: 737 Bytes
Contents
# -*- encoding: utf-8 -*- module Webgen::Tag # Create a link to a given (A)LCN. class Link include Webgen::Tag::Base # Return a HTML link to the given (A)LCN. def call(tag, body, context) if (dest_node = context.ref_node.resolve(param('tag.link.path'), context.dest_node.lang)) context.dest_node.link_to(dest_node, param('tag.link.attr').merge(:lang => context.content_node.lang)) else raise ArgumentError, 'Resolving of path failed' end rescue ArgumentError, URI::InvalidURIError => e log(:error) { "Could not link to path '#{param('tag.link.path')}' in <#{context.ref_node.absolute_lcn}>: #{e.message}" } context.dest_node.flag(:dirty) '' end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
gettalong-webgen-0.5.7.20090227 | lib/webgen/tag/link.rb |
webgen-0.5.7 | lib/webgen/tag/link.rb |