Stott.Optimizely.RobotsHandler
2.1.0
See the version list below for details.
dotnet add package Stott.Optimizely.RobotsHandler --version 2.1.0
NuGet\Install-Package Stott.Optimizely.RobotsHandler -Version 2.1.0
<PackageReference Include="Stott.Optimizely.RobotsHandler" Version="2.1.0" />
paket add Stott.Optimizely.RobotsHandler --version 2.1.0
#r "nuget: Stott.Optimizely.RobotsHandler, 2.1.0"
// Install Stott.Optimizely.RobotsHandler as a Cake Addin #addin nuget:?package=Stott.Optimizely.RobotsHandler&version=2.1.0 // Install Stott.Optimizely.RobotsHandler as a Cake Tool #tool nuget:?package=Stott.Optimizely.RobotsHandler&version=2.1.0
Stott.Optimizely.RobotsHandler
This is a new admin extension for Optimizely CMS 12+ for managing robots.txt on a per site basis. The Stott.Optimizely.RobotsHandler project is a Razor Class Library which contains Razor Files, static JS files and relevent business logic specific to this functionality.
Configuration
After pulling in a reference to the Stott.Optimizely.RobotsHandler project, you only need to ensure the following lines are added to the startup class of your solution:
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddRobotsHandler();
}
The call to services.AddRazorPages()
is a standard .NET call to ensure razor pages are included in your solution.
The call to services.AddRobotsHandler()
sets up the dependency injection requirements for the RobotsHandler solution and is required to ensure the solution works as intended. This works by following the Services Extensions pattern defined by microsoft.
This solution also includes an implementation of IMenuProvider
which ensures that the Robots Handler administration pages are included in the CMS Admin menu under the title of "Robots". You do not have to do anything to make this work as Optimizely CMS will scan and action all implementations of IMenuProvider
.
Authorisation Configuration
The configuration of the module has some scope for modification by providing configuration in the service extension methods. The provision of authorizationOptions
is optional in the following example.
Example:
services.AddRobotsHandler(authorizationOptions =>
{
authorizationOptions.AddPolicy(RobotsConstants.AuthorizationPolicy, policy =>
{
policy.RequireRole("WebAdmins");
});
});
If the authorizationOptions
is not provided, then any of the following roles will be required be default:
- CmsAdmins
- Administrator
- WebAdmins
Contributing
I am open to contributions to the code base. The following rules should be followed:
- Contributions should be made by Pull Requests.
- All commits should have a meaningful messages.
- All commits should have a reference to your GitHub user.
- Ideally all new changes should include appropriate unit test coverage.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- EPiServer.CMS (>= 12.9.0)
- EPiServer.CMS.AspNetCore.Mvc (>= 12.8.0)
- EPiServer.CMS.UI.Core (>= 12.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Update to use .NET 6.0 and to allow chaining of service extensions. Added additional bug fixes and hidden APIs from swagger.