class Jekyll::SeoTag
def drop
def drop if context.registers[:site].liquid_renderer.respond_to?(:cache) Jekyll::SeoTag::Drop.new(@text, @context) else @drop ||= Jekyll::SeoTag::Drop.new(@text, @context) end end
def info
def info { :registers => context.registers, :filters => [Jekyll::Filters], } end
def initialize(_tag_name, text, _tokens)
def initialize(_tag_name, text, _tokens) super @text = text end
def options
def options { "version" => Jekyll::SeoTag::VERSION, "title" => title?, } end
def payload
def payload # site_payload is an instance of UnifiedPayloadDrop. See https://git.io/v5ajm context.registers[:site].site_payload.tap do |site_payload| site_payload["page"] = context.registers[:page] site_payload["paginator"] = context["paginator"] site_payload["seo_tag"] = drop end end
def render(context)
def render(context) @context = context SeoTag.template.render!(payload, info) end
def template
def template @template ||= Liquid::Template.parse template_contents end
def template_contents
def template_contents @template_contents ||= begin File.read(template_path).gsub(MINIFY_REGEX, "") end end
def template_path
def template_path @template_path ||= begin File.expand_path "./template.html", File.dirname(__FILE__) end end