Created
May 28, 2026 10:38
-
-
Save PNergard/1d60247461e486e53ad64722c9656ca1 to your computer and use it in GitHub Desktop.
A CMS 11 example of how to configure exclude patterns for the LinkValidation scheduled job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using EPiServer.Framework; | |
| using EPiServer.Framework.Initialization; | |
| using EPiServer.LinkAnalyzer; | |
| using EPiServer.ServiceLocation; | |
| namespace Pure.MVC.Business.InitializationModules | |
| { | |
| [InitializableModule] | |
| [ModuleDependency(typeof(EPiServer.Web.InitializationModule))] | |
| public class LinkValidatorConfiguration : IConfigurableModule | |
| { | |
| public void ConfigureContainer(ServiceConfigurationContext context) | |
| { | |
| var options = new LinkValidatorOptions(); | |
| options.ExcludePatterns.Add(@"^\s*tel:"); | |
| options.ExcludePatterns.Add(@"^\s*mailto:"); | |
| options.ExcludePatterns.Add(@"^\s*callto:"); | |
| options.ExcludePatterns.Add(@"^\s*sms:"); | |
| options.ExcludePatterns.Add(@"^\s*javascript:"); | |
| options.ExcludePatterns.Add(@"^\s*skype:"); | |
| context.Services.AddSingleton(options); | |
| } | |
| public void Initialize(InitializationEngine context) { } | |
| public void Uninitialize(InitializationEngine context) { } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment