class Moft::Tags::PostUrl

Public Class Methods

new(tag_name, post, tokens) click to toggle source
Calls superclass method
# File lib/moft/tags/post_url.rb, line 23
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/moft/tags/post_url.rb, line 29
def render(context)
  site = context.registers[:site]

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

  puts "ERROR: post_url: \"#{@orig_post}\" could not be found"

  return "#"
end