summaryrefslogtreecommitdiffstats
path: root/blog/_plugins
diff options
context:
space:
mode:
Diffstat (limited to 'blog/_plugins')
-rw-r--r--blog/_plugins/page_title.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/blog/_plugins/page_title.rb b/blog/_plugins/page_title.rb
new file mode 100644
index 0000000..039e859
--- /dev/null
+++ b/blog/_plugins/page_title.rb
@@ -0,0 +1,21 @@
+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)