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
10 changed files
with
75 additions
and
7 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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
class HomeController < ApplicationController | |||
def sitemap | |||
path = Rails.root.join('public', 'sitemaps', 'sitemap.xml') | |||
if File.exists?(path) | |||
render xml: open(path).read | |||
else | |||
render text: 'Sitemap not found.', status: :not_found | |||
end | |||
end | |||
|
|||
def robots; 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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
Sitemap: <%= sitemap_url %> |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,46 @@ | |||
# Change this to your host. | |||
# See the readme at https://github.com/lassebunk/dynamic_sitemaps | |||
# for examples of multiple hosts and folders. | |||
host 'brewformulas.org' | |||
|
|||
sitemap :site do | |||
url root_url, last_mod: Time.now, change_freq: 'daily', priority: 1.0 | |||
end | |||
|
|||
# You can have multiple sitemaps like the above – just make sure their names | |||
# are different. | |||
|
|||
# Automatically link to all pages using the routes specified | |||
# using "resources :pages" in config/routes.rb. This will also | |||
# automatically set <lastmod> to the date and time in page.updated_at: | |||
# | |||
sitemap_for Homebrew::Formula.internals.active, name: :formula do |formula| | |||
url formula_url(formula.name) | |||
end | |||
|
|||
# For products with special sitemap name and priority, and link to comments: | |||
# | |||
# sitemap_for Product.published, name: :published_products do |product| | |||
# url product, last_mod: product.updated_at, | |||
# priority: (product.featured? ? 1.0 : 0.7) | |||
# url product_comments_url(product) | |||
# end | |||
|
|||
# If you want to generate multiple sitemaps in different folders | |||
# (for example if you have more than one domain), you can specify a folder | |||
# before the sitemap definitions: | |||
# | |||
# Site.all.each do |site| | |||
# folder "sitemaps/#{site.domain}" | |||
# host site.domain | |||
# | |||
# sitemap :site do | |||
# url root_url | |||
# end | |||
# | |||
# sitemap_for site.products.scoped | |||
# end | |||
|
|||
# Ping search engines after sitemap generation: | |||
# | |||
# ping_with "http://#{host}/sitemap.xml" |
This file was deleted.
Oops, something went wrong.