ISite
- Namespace: SuCoS.Models
- Source File: ISite.cs
The main configuration of the program, primarily extracted from the app.yaml file.
Properties
Options
(IGenerateOptions) { get; set }: Command line options
SourceContentPath
(string) : The path of the content, based on the source path.
SourceStaticPath
(string) : The path of the static content (that will be copied as is), based on the source path.
SourceThemePath
(string) : The path theme.
CacheManager
(SiteCacheManager) : Manage all caching lists for the site
Parser
(IFrontMatterParser) : Front Matter parser
TemplateEngine
(ITemplateEngine) : The template engine.
Logger
(ILogger) : The logger instance.
SourceFolders
(IEnumerable
Public Methods
ResetCache
public void ResetCache()
Resets the template cache to force a reload of all templates.
ScanAndParseSourceFiles
public void ScanAndParseSourceFiles(IFileSystem fs, string? directory = null, int level = 0, ContentSource? parent = null, FrontMatter? cascade = null)
Search recursively for all markdown files in the content folder, then parse their content for front matter and markdown.
Parameters:
fs(IFileSystem)directory(string?): Folder to scan (Default:null)level(int): Folder recursive level (Default:0)parent(ContentSource?): Page of the upper directory (Default:null)cascade(FrontMatter?) (Default:null)
ProcessPages
public void ProcessPages()
Expand the front matter to full-blown pages.
RegisterPaginatedUrls
public void RegisterPaginatedUrls()
Register paginated URL entries in OutputReferences after all pages are created. Must be called after ProcessPages so ContentSourceToPages is fully populated.
CreatePermalink
Uri CreatePermalink(Page page, string? urlForce = null)
Gets the Permalink path for the file.
Parameters:
page(Page)urlForce(string?): The URL to consider. If null use the predefined URL (Default:null)
Returns: Uri
- The output path.
PostProcessPage
public void PostProcessPage(IPage page, bool overwrite = false)
Extra calculation and automatic data for each page.
Parameters:
page(IPage): The given page to be processedoverwrite(bool) (Default:false)
IsPageValid
public bool IsPageValid(IContentSource frontMatter, IGenerateOptions? options)
Check if the page have the conditions to be published: valid date and not draft, unless a command line option to force it.
Parameters:
frontMatter(IContentSource): Page or front matteroptions(IGenerateOptions?): options
Returns: bool
IsDateValid
public bool IsDateValid(IContentSource contentSource, IGenerateOptions? options)
Check if the page have a publishing date from the past.
Parameters:
contentSource(IContentSource): Page or content Sourceoptions(IGenerateOptions?): options
Returns: bool
IsDateExpired
public bool IsDateExpired(IContentSource contentSource)
Check if the page is expired
Parameters:
contentSource(IContentSource)
Returns: bool
IsDatePublishable
public bool IsDatePublishable(IContentSource contentSource)
Check if the page is publishable
Parameters:
contentSource(IContentSource)
Returns: bool
PageCreate
public List<Page> PageCreate(ContentSource contentSource)
Create a Page from front matter
Parameters:
contentSource(ContentSource)
Returns: List<Page>
ContentSourceAdd
ContentSource? ContentSourceAdd(ContentSource? contentSource)
Include the Front Matter into the site
Parameters:
contentSource(ContentSource?)
Returns: ContentSource?
ParseAndRenderTemplate
string ParseAndRenderTemplate(Page page, bool b)
Parameters:
page(Page)b(bool)
Returns: string