summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Pages/Robots.txt.cshtml3
-rw-r--r--Pages/Sitemap.xml.cshtml21
2 files changed, 23 insertions, 1 deletions
diff --git a/Pages/Robots.txt.cshtml b/Pages/Robots.txt.cshtml
index 54c25f2..4c46b79 100644
--- a/Pages/Robots.txt.cshtml
+++ b/Pages/Robots.txt.cshtml
@@ -6,4 +6,5 @@
User-agent: *
Disallow: /freedom
Disallow: /account
-Disallow: /Account \ No newline at end of file
+Disallow: /Account
+sitemap: https://mydarlingunderwear.ru/sitemap.xml \ No newline at end of file
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