class Jekyll::Tags::PostUrl

Public Class Methods

new(tag_name, post, tokens) click to toggle source
Calls superclass method
# File lib/jekyll/tags/post_url.rb, line 38
def initialize(tag_name, post, tokens)
  super
  @orig_post = post.strip
  @post = PostComparer.new(@orig_post)
end

Public Instance Methods

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

        site.posts.each do |p|
          if @post == p
            return p.url
          end
        end

        raise ArgumentError.new <<-eos
Could not find post "#{@orig_post}" in tag 'post_url'.

Make sure the post exists and the name is correct.
eos
      end