summaryrefslogblamecommitdiffstats
path: root/blog/_plugins/page_title.rb
blob: 039e8593f50486f2453c3a572307e28906f5362f (plain) (tree)




















                                                                 
require "jekyll/multiple/languages/plugin"
require "facets/kernel/silence"

module Jekyll
  class PageTitleTag < Liquid::Tag
    def initialize(tag_name, text, tokens)
      super
      @key = text
    end

    def render(context)
      text = silently do
        t = Jekyll::LocalizeTag.new('t', @key, '')
        t.render(context)
      end
      text || context[@key]
    end
  end
end

Liquid::Template.register_tag('page_title', Jekyll::PageTitleTag)