class Jekyll::Tags::Link

Public Class Methods

new(tag_name, relative_path, tokens) click to toggle source
Calls superclass method
# File lib/jekyll/tags/link.rb, line 10
def initialize(tag_name, relative_path, tokens)
  super

  @relative_path = relative_path.strip
end
tag_name() click to toggle source
# File lib/jekyll/tags/link.rb, line 5
def tag_name
  self.name.split("::").last.downcase
end

Public Instance Methods

render(context) click to toggle source
# File lib/jekyll/tags/link.rb, line 16
      def render(context)
        site = context.registers[:site]

        site.docs_to_write.each do |document|
          return document.url if document.relative_path == @relative_path
        end

        raise ArgumentError, <<eos
Could not find document '#{@relative_path}' in tag '#{self.class.tag_name}'.

Make sure the document exists and the path is correct.
eos
      end