Class: Bridgetown::SeoTag::Builder

Inherits:
Builder
  • Object
show all
Defined in:
lib/bridgetown-seo-tag/builder.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



6
7
8
9
10
11
12
13
14
# File 'lib/bridgetown-seo-tag/builder.rb', line 6

def build
  helper "seo" do |title: true|
    context = Liquid::Context.new({}, {}, { site: site, page: helpers.view.page })
    tag_output = Liquid::Template.parse(
      "{% seo #{"title=false" unless title} %}"
    ).render!(context, {})
    tag_output.respond_to?(:html_safe) ? tag_output.html_safe : tag_output
  end
end