Comments (1)
How to terminate Statiq with a not-0 exit error code when something has failed on start?
It should already be doing this. It'll try to continue processing files within certain modules that run concurrently if it can, that way you don't have to play whack-a-mole by fixing one file, running, fixing the next error, running, fixing the next error, running, etc. If you can see all the errors from a given module like Razor at once, it's a lot faster to fix things. But then at the end, if any errors/exceptions were logged, it'll exit with a non-zero exit code. I've got lots of CI code that runs Statiq and relies on this behavior, is it not doing that for you?
I've enabled Strict mode for the bootstrapper
It actually looks like "strict mode" is a holdover from Wyam code and isn't used in Statiq at all. In general, Statiq should be behaving as if it were in "strict mode" all the time. There is a FailureLogLevel
setting you can set which is probably what Strict
used to do, but provides more control. Try setting this:
Bootstrapper.Factory.CreateWeb(args)
.AddSetting(Keys.FailureLogLevel, LogLevel.Warning)
Is it possible to add custom metadata to a document in run-time (in the pipeline code, etc)?
Absolutely - if writing a custom module, there are a series of extensions that can do this. A document is immutable, so you create a new document, passing any additional metadata you want, and the original is cloned with that new metadata. The CreateDocument()
extensions exist for both the IExecutionContext
and IDocument
to make them easy to find.
There's a bunch of ways to write your own module code, from creating a whole module to doing something like this using the ExecuteConfig
module:
await Bootstrapper.Factory
.CreateWeb(args)
.BuildPipeline(
"MyPipeline",
builder => builder.WithProcessModules(
new ReadFiles("*.foo"),
new ExecuteConfig(
Config.FromDocument((ctx, doc) =>
doc.CreateDocument(new MetadataItems
{
{ "Foo", "Bar" }
})))))
You don't even need to go that far though if you just want to add some metadata during the pipeline - the SetMetadata
module has your back:
await Bootstrapper.Factory
.CreateWeb(args)
.BuildPipeline(
"MyPipeline",
builder => builder.WithProcessModules(
new ReadFiles("*.foo"),
new SetMetadata("Foo", Config.FromDocument(doc => "Bar")))
from statiq.web.
Related Issues (20)
- Release 1.0.0-beta.50 is broken with Search Index Generation enabled HOT 3
- Netlify deployment not deploying dot files/directories HOT 7
- Post is published even if the published date is only tomorrow HOT 5
- Statiq.Web.props to Statiq.Web.targets causing compilation issues HOT 2
- How to set FrontMatterRegexes to use custom Frontmatter? HOT 3
- Sitemap is missing lastmod values HOT 4
- LESS: 'background: center/xx' breaks the compilation HOT 4
- RSS missing feed title HOT 4
- Question: Include example HOT 2
- Microsoft.Azure.Search is Deprecated, and has known vulnerabilities
- install pptx HOT 2
- [Bug] Images don't show on post listing HOT 2
- SCSS regeneration is not working when changing imported files HOT 4
- Stack overflow. Repeat 611 times: Netlify deploy HOT 3
- Make sure IsPost gets set correctly for tags and archive pages HOT 1
- Add minification modules as options
- Analyzer warning when using Unicode Tags. HOT 2
- Link validation appears to be flagging mailto links HOT 4
- Hot reload stops working after a compiler error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statiq.web.