CLASS FileUtils
- Namespace: SuCoS.Helpers
- Source File: FileUtils.cs
Helper methods for scanning files.
Fields
OutputFormats (Dictionary<string, OutputFormat>) = `new()
{
{
"html", new OutputFormat
{
Extension = "html"
}
},
{
"rss", new OutputFormat
{
Extension = "xml",
NoUgly = true
}
},
{
"robots",
new OutputFormat
{
BaseName = "robots",
Extension = "xml",
NoUgly = true
}
}
}`: Default Output Formats
Public Methods
GetTemplate
public static string GetTemplate(Page page, string themePath, SiteCacheManager cacheManager, bool isBaseTemplate = false)
Gets the content of a template file based on the page and the theme path.
Parameters:
page(Page): The page to determine the template index.themePath(string): The theme path.cacheManager(SiteCacheManager): Site data.isBaseTemplate(bool): Indicates whether the template is a base template. (Default:false)
Returns: string
- The content of the template file.
GetTemplateLookupOrder
public static IEnumerable<string> GetTemplateLookupOrder(Page page, bool isBaseTemplate)
Gets the lookup order for template files based on the theme path, page, and template type.
Parameters:
page(Page): The page to determine the template index.isBaseTemplate(bool): Indicates whether the template is a base template.
Returns: IEnumerable<string>
- The list of template paths in the lookup order.