0
0
MyDarling/Pages/Sitemap.xml.cshtml

21 lines
562 B
Plaintext
Raw Normal View History

2023-06-16 07:03:56 +03:00
@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>