internal static void Configure(SeoOptions options, IHostEnvironment env) { options.RobotsTxt.UserAgentRecords = new List <UserAgentRecord> { new UserAgentRecord { DisallowAll = !env.IsProduction() } }; }
private void ShouldReturnTrueForAllEnvironments(string environmentName) { var hostingEnvironment = new TestHostingEnvironment { EnvironmentName = environmentName }; var options = new SeoOptions(); DefaultOptions.Configure(options, hostingEnvironment); options.RobotsTxt.AddSitemapUrl.Should().BeTrue(); }
private void ShouldAllowSiteWideAccessInProduction(string environmentName, bool expected) { var hostingEnvironment = new TestHostingEnvironment { EnvironmentName = environmentName }; var options = new SeoOptions(); DefaultOptions.Configure(options, hostingEnvironment); UserAgentRecord userAgentRecord = options.RobotsTxt.UserAgentRecords.Single(); userAgentRecord.DisallowAll.Should().Be(expected); }
public LayoutModel( StaticPageMenuItem[] menu, SeoOptions seo, string?googleAnalyticsClientId, string?fontAwesomeId, string?themeColor, IReadOnlyDictionary <string, string> metaTags) { Menu = menu; Seo = seo; GoogleAnalyticsClientId = googleAnalyticsClientId; FontAwesomeId = fontAwesomeId; ThemeColor = themeColor; MetaTags = metaTags; }