statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.64k stars 236 forks source link

Add theme directive to config file if specified during scaffolding #524

Open WestDiscGolf opened 7 years ago

WestDiscGolf commented 7 years ago

As per the twitter conversation here - https://twitter.com/Wyamio/status/867397906868969473 - I am unable to get the phantom blog theme to run it always defaults to Clean blog.

Apologies for the formatting I couldn't get it to work :-(

Running:

wyam new -r Blog --verbose

The output is:

Wyam version 0.18.3

[the rest was removed for brevity :smile: ]

WestDiscGolf commented 7 years ago

And then running

wyam -r Blog -t Phantom --verbose

The output is:

Wyam version 0.18.3

[log removed]

WestDiscGolf commented 7 years ago

and then when I run preview:

wyam -p -w

I get:

Wyam version 0.18.3

[log removed]

But runs CleanBlog and not Phantom.

Am I doing something wrong?

Cheers

daveaglick commented 7 years ago

Ah, I think I see the problem. When you run new it bakes the recipe into the wyam.config file but not the theme, even if one was specified.

So when you ran the first build, I could see files being copied to the output from "file:///C:/Users/Adam/.nuget/packages/Wyam.Blog.Phantom.0.18.3/content" since -t Phantom was used. However, when you ran the preview, no -t was specified so it just picked up the default theme. To get it to preview with Phantom, make sure you add -t Phantom to every command line or add #theme Phantom to the config.wyam file.

I'm not sure I'd call this a bug per-se - I just never considered that someone might run new and scaffold a site with a theme specified. It makes perfect sense why you were confused though. I'm going to retitle this issue and use it as a feature request to scaffold the appropriate #theme directive into the config.wyam file if one was specified during the wyam new execution.

WestDiscGolf commented 7 years ago

That makes sense. Will give it a go later. Thanks for looking into it :-)