Skip to content

Commit

Permalink
Added optional structure title.
Browse files Browse the repository at this point in the history
  • Loading branch information
tidyui committed Jan 3, 2021
1 parent a931f8b commit 665db80
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/Statica/Models/StaticStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ namespace Statica.Models
public class StaticStructure
{
/// <summary>
/// The unique structure id.
/// Gets/sets the unique structure id.
/// </summary>
public string Id { get; set; }

/// <summary>
/// Gets/sets the optional title.
/// </summary>
public string Title { get; set; }

/// <summary>
/// Gets/sets the base slug.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Statica/Services/IStructureService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public interface IStructureService
/// </summary>
string Id { get; }

/// <summary>
/// Gets the optional title.
/// </summary>
string Title { get; }

/// <summary>
/// Gets the current sitemap.
/// </summary>
Expand Down
12 changes: 11 additions & 1 deletion src/Statica/Services/StructureService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -40,11 +43,13 @@ public class StructureService : IStructureService
/// <param name="id">The unique id</param>
/// <param name="baseSlug">The base slug</param>
/// <param name="dataPath">The data path</param>
public StructureService(string id, string baseSlug, string dataPath)
/// <param name="title">The optional title</param>
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 += "/";
Expand All @@ -55,6 +60,11 @@ public StructureService(string id, string baseSlug, string dataPath)
/// </summary>
public string Id => _id;

/// <summary>
/// Gets the optional title.
/// </summary>
public string Title => _title;

/// <summary>
/// Gets the current page structure.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Statica/Statica.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>0.3.2</Version>
<Version>0.3.3</Version>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<PackageId>Statica</PackageId>
<PackageVersion>0.3.2</PackageVersion>
<PackageVersion>0.3.3</PackageVersion>
<Authors>Håkan Edling</Authors>
<Description>Piranha Module for generating a partial page structure from local markdown files.</Description>
<Copyright>Copyright 2019-2021 (c) Håkan Edling</Copyright>
Expand Down

0 comments on commit 665db80

Please sign in to comment.