OptimizeFileName Class
Optimizes a file name.
graph BT Type-->Base0["ParallelSyncMultiConfigModule"] click Base0 "/api/Statiq.Common/ParallelSyncMultiConfigModule" Base0-->Base1["ParallelMultiConfigModule"] click Base1 "/api/Statiq.Common/ParallelMultiConfigModule" Base1-->Base2["MultiConfigModuleBase"] click Base2 "/api/Statiq.Common/MultiConfigModuleBase" Base2-->Base3["Module"] click Base3 "/api/Statiq.Common/Module" Base3-->Base4["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type-.->Interface1["IParallelModule"] click Interface1 "/api/Statiq.Common/IParallelModule" Type["OptimizeFileName"] class Type type-node

Syntax

public class OptimizeFileName : ParallelSyncMultiConfigModule, IModule, IParallelModule

Remarks

This module takes the destination file name (or the value of a specified metadata key) and optimizes it by removing reserved characters, white-listing characters, etc.

Constructors

Name Summary
OptimizeFileName() Optimizes the destination file name of each input document.
OptimizeFileName(Config<NormalizedPath>, string) Optimizes the file name in the resulting path and sets the specified metadata key.
OptimizeFileName(string, string) Optimizes the file name stored in the given metadata key and stores it at the provided key.
OptimizeFileName(string) Optimizes the file name stored in the given metadata key and stores it back in the same key.

Properties

Name Property Type Summary
Configs IReadOnlyDictionary<string, IConfig>
Inherited from MultiConfigModuleBase
ForceDocumentExecution bool
Inherited from MultiConfigModuleBase
Parallel bool
Indicates whether documents will be processed by this module in parallel.

Methods

Name Return Value Summary
AfterExecution(IExecutionContext, ExecutionOutputs) void
Called after each module execution.
Inherited from Module
AfterExecutionAsync(IExecutionContext, ExecutionOutputs) Task
Called after each module execution.
Inherited from Module
BeforeExecution(IExecutionContext) void
Called before each module execution.
Inherited from Module
BeforeExecutionAsync(IExecutionContext) Task
Called before each module execution.
Inherited from Module
CollapseSpaces(Config<bool>) OptimizeFileName
CombineConfig<TValue>(string, Config<TValue>, Func<TValue, TValue, IDocument, IExecutionContext, Task<TValue>>) MultiConfigModuleBase
Inherited from MultiConfigModuleBase
CombineConfig<TValue>(string, Config<TValue>, Func<TValue, TValue, IDocument, IExecutionContext, TValue>) MultiConfigModuleBase
Inherited from MultiConfigModuleBase
CombineConfig<TValue>(string, Config<TValue>, Func<TValue, TValue, IExecutionContext, Task<TValue>>) MultiConfigModuleBase
Inherited from MultiConfigModuleBase
CombineConfig<TValue>(string, Config<TValue>, Func<TValue, TValue, IExecutionContext, TValue>) MultiConfigModuleBase
Inherited from MultiConfigModuleBase
CombineConfig<TValue>(string, Config<TValue>, Func<TValue, TValue, Task<TValue>>) MultiConfigModuleBase
Inherited from MultiConfigModuleBase
CombineConfig<TValue>(string, Config<TValue>, Func<TValue, TValue, TValue>) MultiConfigModuleBase
Inherited from MultiConfigModuleBase
ExecuteAsync(IExecutionContext) Task<IEnumerable<IDocument>>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
ExecuteConfig(IDocument, IExecutionContext, IMetadata) IEnumerable<IDocument>
ExecuteConfigAsync(IDocument, IExecutionContext, IMetadata) Task<IEnumerable<IDocument>>
Executes the module for each input document. If there aren't any input documents and the config delegate doesn't require documents, this will be called once with a null input.
ExecuteContextAsync(IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module once for all input documents.
ExecuteInputAsync(IDocument, IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module.
Inherited from MultiConfigModuleBase
Finally(IExecutionContext) void
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
FinallyAsync(IExecutionContext) Task
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
GetConfig(string) IConfig
Gets the config for a given key.
Inherited from MultiConfigModuleBase
GetConfig<TValue>(string) Config<TValue>
Gets the config for a given key cast to a specific config value.
Inherited from MultiConfigModuleBase
SetConfig(string, IConfig) MultiConfigModuleBase
Sets the config for a given key.
Inherited from MultiConfigModuleBase
SpacesToDashes(Config<bool>) OptimizeFileName
ToLower(Config<bool>) OptimizeFileName
TrimDot(Config<bool>) OptimizeFileName
TryGetConfig(string, IConfig) bool
Inherited from MultiConfigModuleBase
WithReservedCharacters(Config<string>) OptimizeFileName
Specifies the characters not to allow in the file name.

Extension Methods