summaryrefslogtreecommitdiff
path: root/Pages/Sitemap.xml.cshtml
diff options
context:
space:
mode:
Diffstat (limited to 'Pages/Sitemap.xml.cshtml')
-rw-r--r--Pages/Sitemap.xml.cshtml21
1 files changed, 21 insertions, 0 deletions
diff --git a/Pages/Sitemap.xml.cshtml b/Pages/Sitemap.xml.cshtml
new file mode 100644
index 0000000..f686066
--- /dev/null
+++ b/Pages/Sitemap.xml.cshtml
@@ -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> \ No newline at end of file