diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/Robots.txt b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/Robots.txt new file mode 100644 index 0000000000..99b18ec27e --- /dev/null +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/Robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Disallow: +Sitemap: https://use-your-server-url-here.com/sitemap.xml \ No newline at end of file diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.js index 626dea5dbe..088070c5e0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.js @@ -29,7 +29,8 @@ self.serverHandledUrls = [ /\/healthz/, /\/swagger/, /\/signin-/, - /\/.well-known/ + /\/.well-known/, + /\/sitemap.xml/, ]; self.defaultUrl = "/"; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs index def2f8619d..fbe796a2ee 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs @@ -128,12 +128,12 @@ private static void UseSiteMap(this WebApplication app) .ToList()!; urls = CultureInfoManager.MultilingualEnabled ? - CultureInfoManager.SupportedCultures.SelectMany(sc => urls.Select(url => $"{url}?culture={sc.Culture.Name}")).ToList() : + urls.Union(CultureInfoManager.SupportedCultures.SelectMany(sc => urls.Select(url => $"{url}?culture={sc.Culture.Name}"))).ToList() : urls; const string siteMapHeader = "\r\n"; - app.MapGet("/sitemap.XML", async context => + app.MapGet("/sitemap.xml", async context => { if (siteMap is null) {