diff --git a/source/Models/Frontmatter.cs b/source/Models/Frontmatter.cs index 56ae87acb3a6c79273d0dd9706208af6d525ef7e..33cd6236d29b9e1591d06bd1bc161b3de5c50a92 100644 --- a/source/Models/Frontmatter.cs +++ b/source/Models/Frontmatter.cs @@ -117,6 +117,7 @@ public class Frontmatter : IBaseContent, IParams /// Other content that mention this content. /// Used to create the tags list and Related Posts section. /// + [YamlIgnore] public ConcurrentBag? PagesReferences { get; set; } /// @@ -136,6 +137,21 @@ public class Frontmatter : IBaseContent, IParams [YamlIgnore] public bool IsDatePublishable => GetPublishDate is null || GetPublishDate <= clock.Now; + /// + /// Just a simple check if the current page is the home page + /// + public bool IsHome => Site.Home == this; + + /// + /// Just a simple check if the current page is a section page + /// + public bool IsSection => Type == "section"; + + /// + /// Just a simple check if the current page is a "page" + /// + public bool IsPage => Type == "page"; + /// /// The markdown content converted to HTML /// diff --git a/source/Models/Site.cs b/source/Models/Site.cs index f44eeb0f31dd60f4677a6c91d3e373ea304cf123..4ec4c888b438c3d6b7b008375269832bdb836967 100644 --- a/source/Models/Site.cs +++ b/source/Models/Site.cs @@ -117,7 +117,7 @@ public class Site : IParams /// /// The frontmatter of the home page; /// - public Frontmatter? HomePage { get; set; } + public Frontmatter? Home { get; set; } /// /// List of all content to be scanned and processed. @@ -346,7 +346,7 @@ public class Site : IParams { home = CreateIndexPage(string.Empty); } - HomePage = home; + Home = home; home.Kind = Kind.index; stopwatch.Stop("Parse", filesParsed);