Skip to content

Commit 463dc49

Browse files
committed
Enhance project packing and markdown processing
- Added logging in Build-LocalPackages.ps1 to indicate which project is being packed and ensured each project is processed individually with the correct version and output path. - Refactored SiteGenerator.cs to improve markdown file handling by moving the pipeline instantiation inside the loop for each markdown page, ensuring statelessness and deterministic behavior. Added comments for clarity.
1 parent 82a250e commit 463dc49

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Build-LocalPackages.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ if ($Version -notlike "*-alpha*") {
4747
Write-Host "Packing all projects with version $Version..."
4848

4949
foreach ($proj in $projects) {
50+
Write-Host "`nPacking project: $proj"
51+
dotnet restore $proj
52+
dotnet build $proj -c Release
5053
dotnet pack $proj -c Release -p:PackageVersion=$Version -o $OutputPath
5154
}
5255

src/Blake.BuildTools/Generator/SiteGenerator.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,15 @@ public static async Task BuildAsync(GenerationOptions? options = null)
126126
}
127127

128128

129-
// Bake: Process each markdown file and generate Razor pages
130-
var mdPipeline = context.PipelineBuilder.Build();
131-
using var sw = new StringWriter();
132-
var renderer = new HtmlRenderer(sw);
133-
mdPipeline.Setup(renderer);
134-
135129
foreach (var mdPage in context.MarkdownPages)
136-
{
130+
{
131+
// Pipeline is instantiated for each page
132+
// This ensures statelessness and guarantees deterministic behavior
133+
var mdPipeline = context.PipelineBuilder.Build();
134+
using var sw = new StringWriter();
135+
var renderer = new HtmlRenderer(sw);
136+
mdPipeline.Setup(renderer);
137+
137138
var mdContent = mdPage.RawMarkdown;
138139

139140
var frontmatter = FrontmatterHelper.ParseFrontmatter(mdContent, cleanedContent: out _);

0 commit comments

Comments
 (0)