theread.me/_plugins/fa.rb

15 lines
370 B
Ruby
Raw Permalink Normal View History

2022-11-13 11:59:19 +00:00
# Wraps text in .lang-fa div
module Farsi
class FarsiTag < Liquid::Block
def render(context)
text = super
site = context.registers[:site]
converter = site.find_converter_instance(::Jekyll::Converters::Markdown)
"<div class='lang-fa'>#{converter.convert(text)}</div>"
end
end
end
Liquid::Template.register_tag('fa', Farsi::FarsiTag)