feat: add sitemap for help center (#9280)
* feat: start sitemap * feat: add base url and last mod to sitemap * fix: typo * test: sitemap generation * test: add draft articles * fix: escape dots in regex matching * feat: perpend protocol to the url * feat: use ChatwootApp.help_center_root * feat: don't parse the URL * fix: function declaration
This commit is contained in:
9
app/views/public/api/v1/portals/sitemap.xml.erb
Normal file
9
app/views/public/api/v1/portals/sitemap.xml.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sitemapindex>
|
||||
<% @portal.articles.where(status: :published).each do |article| %>
|
||||
<sitemap>
|
||||
<loc><%= @help_center_url %><%= generate_article_link(@portal.slug, article.slug, false, false) %></loc>
|
||||
<lastmod><%= article.updated_at.strftime("%Y-%m-%d") %></lastmod>
|
||||
</sitemap>
|
||||
<% end %>
|
||||
</sitemapindex>
|
||||
Reference in New Issue
Block a user