Skip to content

Commit

Permalink
Upgrade to Bridgetown 1.2 (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Oct 8, 2022
1 parent eab4ecc commit 4ed524b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions bridgetown-seo-tag.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/bridgetownrb/bridgetown-seo-tag"
spec.license = "MIT"

spec.required_ruby_version = ">= 2.5.0"
spec.required_ruby_version = ">= 2.7.0"

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|script|spec|features)/!) }
spec.require_paths = ["lib"]

spec.add_dependency "bridgetown", ">= 0.20.0", "< 2.0"
spec.add_dependency "bridgetown", ">= 1.2.0.beta1", "< 2.0"

spec.add_development_dependency "bundler", ">= 1.15"
spec.add_development_dependency "html-proofer", "~> 3.7"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.5"
spec.add_development_dependency "rubocop-bridgetown", "~> 0.3"
end
5 changes: 4 additions & 1 deletion lib/bridgetown-seo-tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,8 @@ def template_path
end

Liquid::Template.register_tag("seo", Bridgetown::SeoTag)

require "bridgetown-seo-tag/builder"

Bridgetown.initializer :"bridgetown-seo-tag" do
builder Bridgetown::SeoTag::Builder
end
6 changes: 2 additions & 4 deletions lib/bridgetown-seo-tag/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module Bridgetown
class SeoTag
class Builder < Bridgetown::Builder
def build
helper "seo", helpers_scope: true do |title: true|
context = Liquid::Context.new({}, {}, { site: site, page: view.page })
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, {})
Expand All @@ -15,5 +15,3 @@ def build
end
end
end

Bridgetown::SeoTag::Builder.register
2 changes: 1 addition & 1 deletion lib/bridgetown-seo-tag/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module Liquid; class Tag; end; end # rubocop:disable Lint/EmptyClass

module Bridgetown
class SeoTag < Liquid::Tag
VERSION = "5.0.0"
VERSION = "6.0.0"
end
end

0 comments on commit 4ed524b

Please sign in to comment.