diff --git a/lib/jekyll-seo-tag.rb b/lib/jekyll-seo-tag.rb index 2575fc4..a926ddb 100644 --- a/lib/jekyll-seo-tag.rb +++ b/lib/jekyll-seo-tag.rb @@ -3,6 +3,13 @@ module Jekyll attr_accessor :context + def initialize(_, markup, _) + super + @options = { + "title" => !(markup =~ /title\s*:\s*false/i) + } + end + def render(context) @context = context output = template.render!(payload, info) @@ -15,7 +22,8 @@ module Jekyll def payload { "page" => context.registers[:page], - "site" => context.registers[:site].site_payload["site"] + "site" => context.registers[:site].site_payload["site"], + "seo" => @options } end diff --git a/lib/template.html b/lib/template.html index 85e9226..b8c8096 100644 --- a/lib/template.html +++ b/lib/template.html @@ -44,7 +44,7 @@ {% assign seo_description = seo_description | markdownify | strip_html | strip_newlines | escape_once %} {% endif %} -{% if seo_title %} +{% if seo_title and seo.title %}