Migrating from Wyam - Confused about Default Pipelines #158
-
Firstly, if this is the wrong place/method to ask questions, please point me in the right direction. I'm currently using:
I feel I must be doing this wrong, as I've had to effectively disable all the default pipelines and create the same pipelines we had whilst using Wyam. I'm almost at the point of using Statiq.App instead of Static.Web, but for development purposes we want the hosted webserver, hence using Statiq.Web. Here's some example code, which is working but I feel it must be the wrong approach: https://gist.github.com/shortbloke/de13dd33c0b12409353a3116dd8ce84c Question 1: I'd have thought I'd be able to add the option to Question 2: Does each pipeline re-read all the files? I'm wondering if this multiple pipeline approach for simple tasks is inefficient. Should I be creating a fewer pipelines that take action based on the file type? Using Question 3: The default pipeline runs Analyzers. This triggers warnings for all the links in my files. I'm not sure why:
I thought I could disable the ValidateRelativeLinks but setting it to false in the settings.yml file doesn't work, and there doesn't appear to be settable via: Question 4: If using defined pipelines as I have is an acceptable way to go. Then is there a way to remove all the other default pipelines, rather than run them with an empty file list?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Nope, this is the right place! I'm trying to consolidate all the Q/A style issues here in org-level discussions.
Statiq Web is similar in concept (if not implementation) to the old Wyam Blog recipe. It creates a set of default pipelines that are designed, even more than Wyam's were, to be turnkey with customizations being entirely performed using features driven by input files like archives, feeds, and others. For a site that used the in-box Wyam Blog recipe without much customization, the porting should be relatively straightforward. There's some guidance for porting from a simple Wyam blog to Statiq here: https://github.com/statiqdev/CleanBlog#porting-from-wyam (note that the instructions are related to a theme this time around - because Statiq Web customization is so heavily oriented around input files it means that the theme retains a lot of control over things like conventions). That said, a Wyam site that had lots of custom pipelines is probably better off, at least initially, using Statiq Framework and the Does that make sense at a general level?
What's going on here is that the So in your case, by adding the What you want to do in this case is use another new Statiq Web feature called templates. The idea is that if the content type of a document indicates what general kind of treatment it should get (and thus which pipelines to send it through), the media type of a document determines more specific file-type processing. This using Statiq.Minification;
await Bootstrapper.Factory
.CreateWeb(args)
.AddTemplate(MediaTypes.JavaScript, ContentType.Asset, Phase.PostProcess, new MinifyJs())
.RunAsync(); It's definitely totally different than how Wyam did file-type-specific processing, but it's hopefully much more powerful and easier to customize. Also note for what it's worth that in-box minification will eventually be added directly to Statiq Web and controlled by settings. I went searching for the corresponding issue to past here and was shocked I hadn't created one - it's just been in my head. So here's a new issue to track adding minification to Statiq Web by default, though I have no idea when I'll get to it: statiqdev/Statiq.Web#996
Not in Statiq Web (and not really in Statiq Framework either when using the
And you've inadvertently arrived at exactly what Statiq Web does :) - in Statiq Web, all documents are "read" once in the If not using Statiq Web, following a similar pattern is suggested as you pointed out. Set up one pipeline to gather all your input files and create documents, then use that pipeline as a dependency to feed as many other more purpose-specific pipelines as needed (
Analyzers are a new concept in Statiq Web. They've been through a few iterations and should be mostly stable and tested at this point, though it's always possible new patterns could confuse the ones in the box like That said, it looks like in this case the
Analyzer usage can be set in settings, but the syntax is a little tricky. To disable this particular analyzer you'd write (see near the bottom of https://www.statiq.dev/guide/execution/analyzers): Analyzers:
- ValidateRelativeLinks=None
You could remove them all by calling But if what you really want is Statiq Framework just with the preview server but without any other Statiq Web features, you can also reference
Note that this approach won't light up support for all the other Statiq Web features like templates, etc. though and you'll need to do all those manually (just like you would in Statiq Framework). That's because a lot of those features are directly tied to what the default pipelines do. Hopefully that answers most of your questions! Always happy for a follow-up if anything is still unclear. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your comprehensive response. I've quickly been able to use Statiq Framework, with .web for the preview server. |
Beta Was this translation helpful? Give feedback.
Nope, this is the right place! I'm trying to consolidate all the Q/A style issues here in org-level discussions.
Statiq Web is similar in concept (if not implementation) to the old Wyam Blog recipe. It creates a set of default pipelines that are designed, even more than Wyam's were, to be turnkey with customizations being entirely performed using features driven by input files like archives, feeds, and others.
For a site that used the i…