Add sitemap
This commit is contained in:
parent
ecf537fdca
commit
f6f75d364f
@ -7,3 +7,4 @@ User-agent: *
|
|||||||
Disallow: /freedom
|
Disallow: /freedom
|
||||||
Disallow: /account
|
Disallow: /account
|
||||||
Disallow: /Account
|
Disallow: /Account
|
||||||
|
sitemap: https://mydarlingunderwear.ru/sitemap.xml
|
21
Pages/Sitemap.xml.cshtml
Normal file
21
Pages/Sitemap.xml.cshtml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
@page "/sitemap.xml"
|
||||||
|
@using Microsoft.AspNetCore.Http
|
||||||
|
@{
|
||||||
|
var pages = new List<dynamic>
|
||||||
|
{
|
||||||
|
new {Url = "https://mydarlingunderwear.ru/", LastUpdated = DateTime.Today}
|
||||||
|
};
|
||||||
|
Layout = null;
|
||||||
|
Response.ContentType = "text/xml";
|
||||||
|
await Response.WriteAsync("<?xml version='1.0' encoding='UTF-8' ?>");
|
||||||
|
}
|
||||||
|
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
@foreach (var p in pages)
|
||||||
|
{
|
||||||
|
<url>
|
||||||
|
<loc>@p.Url</loc>
|
||||||
|
<lastmod>@p.LastUpdated.ToString("yyyy-MM-dd")</lastmod>
|
||||||
|
</url>
|
||||||
|
}
|
||||||
|
</urlset>
|
Loading…
Reference in New Issue
Block a user