mirror of
https://github.com/discourse/discourse.git
synced 2024-12-30 06:53:58 +08:00
6f76a12e0a
* FEATURE: Let sites add a sitemap.xml file. This PR adds the same features discourse-sitemap provides to core. Sitemaps are only added to the robots.txt file if the `enable_sitemap` setting is enabled and `login_required` disabled. After merging discourse/discourse-sitemap#34, this change will take priority over the sitemap plugin because it will disable itself. We're also using the same sitemaps table, so our migration won't try to create it again using `if_not_exists: true`.
10 lines
350 B
Plaintext
10 lines
350 B
Plaintext
<?xml version="1.0" encoding="UTF-8"?>
|
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
<% @sitemaps.each do |sitemap| %>
|
|
<sitemap>
|
|
<loc><%= Discourse.base_url %>/sitemap_<%= sitemap.name %>.xml</loc>
|
|
<lastmod><%= sitemap.last_posted_at.xmlschema %></lastmod>
|
|
</sitemap>
|
|
<% end %>
|
|
</sitemapindex>
|