-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
7 changed files
with
36 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,4 @@ | |
/node_modules/ | ||
|
||
repomix-output.txt | ||
sitemap.xml.gz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,3 +105,5 @@ group :test do | |
gem "capybara" | ||
gem "selenium-webdriver" | ||
end | ||
|
||
gem "sitemap_generator", "~> 6.3" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class SitemapRefreshJob < ApplicationJob | ||
queue_as :default | ||
|
||
def perform | ||
Rails.logger.info "Refreshing sitemap..." | ||
Rails.application.load_tasks | ||
Rake::Task["sitemap:create"].invoke | ||
Rails.logger.info "Sitemap refresh complete" | ||
end | ||
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,6 @@ | ||
Rails.application.config.after_initialize do | ||
if defined?(Rails::Server) | ||
# Give the app a few seconds to fully initialize before generating sitemap | ||
SitemapRefreshJob.set(wait: 10.seconds).perform_later | ||
end | ||
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,11 @@ | ||
# Set the host name for URL creation | ||
SitemapGenerator::Sitemap.default_host = "https://clusterheadachetracker.com" | ||
|
||
SitemapGenerator::Sitemap.create do | ||
# Add static pages | ||
add root_path, priority: 1.0, changefreq: "daily" | ||
add faq_path, priority: 0.7, changefreq: "monthly" | ||
add imprint_path, priority: 0.7, changefreq: "monthly" | ||
add privacy_policy_path, priority: 0.7, changefreq: "monthly" | ||
add feedback_path, priority: 0.7, changefreq: "monthly" | ||
end |