-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff64dfd
commit 1a8e588
Showing
6 changed files
with
143 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
bridgetown-core/lib/bridgetown-core/configurations/feed.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
say_status :feed, "Adding bridgetown-feed gem" | ||
|
||
bundle_command = <<~BUNDLE | ||
bundle info bridgetown-feed || | ||
bundle add bridgetown-feed -g bridgetown_plugins | ||
BUNDLE | ||
|
||
run bundle_command, { verbose: false, capture: true } | ||
|
||
say_status :feed, "Adding feed tags" | ||
|
||
head_file = Dir.glob("src/**/{head.liquid,_head.erb,_head.serb}").first | ||
|
||
unless head_file | ||
say_status :feed, "Feed tags could not be automatically inserted" | ||
say_status :feed, "To enable, output `feed` in the application <head> element" \ | ||
"using the relevant template language tags" | ||
say "" | ||
say "For help with tag configuration see #{"https://github.com/bridgetownrb/bridgetown-feed#readme".yellow.bold}" | ||
|
||
return | ||
end | ||
|
||
File.open(head_file, "a+") do |file| | ||
feed_tag = Bridgetown::Utils.build_output_tag_for_template_extname( | ||
File.extname(head_file), | ||
"feed_meta" | ||
) | ||
|
||
file.write("#{feed_tag}\n") unless file.grep(%r{#{feed_tag}}).any? | ||
|
||
say "" | ||
say_status :feed, "Feed tags added to #{head_file}" | ||
say_status :feed, "For help with tag configuration see #{"https://github.com/bridgetownrb/bridgetown-feed#readme".yellow.bold}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
say_status :seo, "Adding bridgetown-seo-tag gem" | ||
|
||
bundle_command = <<~BUNDLE | ||
bundle info bridgetown-seo-tag || | ||
bundle add bridgetown-seo-tag -g bridgetown_plugins | ||
BUNDLE | ||
|
||
run bundle_command, { verbose: false, capture: true } | ||
|
||
say_status :seo, "Adding SEO tags" | ||
|
||
head_file = Dir.glob("src/**/{head.liquid,_head.erb,_head.serb}").first | ||
|
||
unless head_file | ||
say_status :seo, "SEO tags could not be automatically inserted" | ||
say_status :seo, "To enable SEO, output `seo` in the application <head> element" \ | ||
"using the relevant template language tags" | ||
say "" | ||
say "For help with tag configuration see #{"https://github.com/bridgetownrb/bridgetown-seo-tag#readme".yellow.bold}" | ||
|
||
return | ||
end | ||
|
||
File.open(head_file, "a+") do |file| | ||
seo_tag = Bridgetown::Utils.build_output_tag_for_template_extname(File.extname(head_file), "seo") | ||
|
||
file.write("#{seo_tag}\n") unless file.grep(%r{#{seo_tag}}).any? | ||
|
||
say "" | ||
say_status :seo, "SEO tags added to #{head_file}" | ||
say_status :seo, "For help with tag configuration see #{"https://github.com/bridgetownrb/bridgetown-seo-tag#readme".yellow.bold}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters