statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.

Home Page:https://statiq.dev/web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about command line "-i" parameter after update to 1.0.0-beta.39

jermdavis opened this issue · comments

When I upgrade my site's project to beta 39, I'm finding that I can no longer run the generation process if I have specified the command line parameter to pick a different input folder. I have a blog site with >250 posts which takes a while to generate. So I was using a second input folder with just the posts I was working on to allow for faster refreshes while I'm writing new content - and that's stopped working with the latest nuget package.

Before I changed the package reference to the latest version, I could supply -i and see both my custom folder and the theme's input folder in the input sources. Running

dotnet run -- preview -i "somefolder"

would generate my site correctly:
image

But after I change the package reference to the latest version, supplying -i causes the generation to break. Firstly I no longer see the theme folder in the inputs:
image
And then generation of my site fails because it can no longer find my theme's _layout.cshtml file. Each page it tries to render throws an exception along the lines of:
image

After a bit of head-scratching, I realise I can fix this by specifying a second -i parameter for the theme's input folder too. Running

dotnet run -- preview -i "somefolder" -i "theme\input"

resolves the issue with the layout file.

But I'm wondering if this is a deliberate change, or a bug that's appeared recently? I couldn't see anything in the release notes for the recent web and framework packages that seemed to match this behaviour change? I'm fairly new to the framework, so I may have misunderstood something in those notes I suppose - but I figured I should raise this in case it was a bug...

This certainly looks like a regression bug. I'm going to guess the work I did to support theme projects (which have some tricky chicken-and-egg ordering with other initialization operations) is at fault. The ordering of command line input paths and theme paths probably got mixed up. I'll take a look and publish a patch.

Thanks for reporting! Glad you found this so early too.

No problem. Thank you for your work on this project - much appreciated.

This is fixed and a new release is rolling out now (assuming some new build tooling I put in place doesn't blow up).