diff --git a/src/Statica/Models/StaticStructure.cs b/src/Statica/Models/StaticStructure.cs index 31af344..877309b 100644 --- a/src/Statica/Models/StaticStructure.cs +++ b/src/Statica/Models/StaticStructure.cs @@ -13,10 +13,15 @@ namespace Statica.Models public class StaticStructure { /// - /// The unique structure id. + /// Gets/sets the unique structure id. /// public string Id { get; set; } + /// + /// Gets/sets the optional title. + /// + public string Title { get; set; } + /// /// Gets/sets the base slug. /// diff --git a/src/Statica/Services/IStructureService.cs b/src/Statica/Services/IStructureService.cs index 98437a2..bbf0374 100644 --- a/src/Statica/Services/IStructureService.cs +++ b/src/Statica/Services/IStructureService.cs @@ -20,6 +20,11 @@ public interface IStructureService /// string Id { get; } + /// + /// Gets the optional title. + /// + string Title { get; } + /// /// Gets the current sitemap. /// diff --git a/src/Statica/Services/StructureService.cs b/src/Statica/Services/StructureService.cs index 9fb9d84..f7f0b3c 100644 --- a/src/Statica/Services/StructureService.cs +++ b/src/Statica/Services/StructureService.cs @@ -22,6 +22,9 @@ public class StructureService : IStructureService // The unique id private readonly string _id; + // The optional title + private readonly string _title; + // The base slug for the structure private readonly string _baseSlug; @@ -40,11 +43,13 @@ public class StructureService : IStructureService /// The unique id /// The base slug /// The data path - public StructureService(string id, string baseSlug, string dataPath) + /// The optional title + public StructureService(string id, string baseSlug, string dataPath, string title = null) { _id = id; _baseSlug = baseSlug; _dataPath = dataPath; + _title = title; if (!string.IsNullOrWhiteSpace(_baseSlug) && !_baseSlug.EndsWith("/")) _baseSlug += "/"; @@ -55,6 +60,11 @@ public StructureService(string id, string baseSlug, string dataPath) /// public string Id => _id; + /// + /// Gets the optional title. + /// + public string Title => _title; + /// /// Gets the current page structure. /// diff --git a/src/Statica/Statica.csproj b/src/Statica/Statica.csproj index 6b7a8ad..2003063 100644 --- a/src/Statica/Statica.csproj +++ b/src/Statica/Statica.csproj @@ -2,14 +2,14 @@ netcoreapp3.1 - 0.3.2 + 0.3.3 true true true snupkg Statica - 0.3.2 + 0.3.3 Håkan Edling Piranha Module for generating a partial page structure from local markdown files. Copyright 2019-2021 (c) Håkan Edling