Samples? Finding it hard to know how to start. #139
-
Hi, where can I find samples of all the different modules and pipelines? It's really difficult to get started. I have a lot of JSON files which I would like to use as a base for generating many html output files via razor. I'm comfortable with Razor and it means I will be able to produce the correct html based on what the JSON structure is like, since each json file doesnt always have the same data. Anywhere to get started? I looked a lot on the website and the guide section but I'm still not finding an easy way to begin. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
In general, Statiq Web is structured in a way that most of the pipeline and module stuff (at least creating or editing them yourself) is abstracted away from you (much like every other static site generator - I.e. it's not common to crack open Jekyll to change how it works). That said, the internals are there for use when the default set of features doesn't satisfy. In this case though, it sounds like you can probably get by with the built-in features of Statiq Web. Hopefully you've been able to get a boilerplate up and running by following the quick start. At that point you should be able to generate a site (a mostly empty one, but still) by calling From there it's a matter of adding the right files to the Once the JSON files are being processed as data files inside Statiq and the resulting document exposed through the "Data" pipeline, you can use them in a Razor file. One way would be to write a single Razor file that iterates them all and renders content based on them. It sounds like you want to do something more like multiple outputs per JSON (or even per individual JSON object) though. There's a few facilities you can use for that:
In any case, there are probably several ways to accomplish what you're looking to do and the "right" one is more a matter of preference and the specific use case. As far as examples go, there are several sites build on Statiq that do similar-ish things:
I'd recommend cloning any one of those and trying to dissect it a bit to understand what's going on. Does that help at all? Let me know if you have more details about your specific use case and we can maybe dive a little more in-depth once you've had a chance to look at some of the existing sites. |
Beta Was this translation helpful? Give feedback.
-
Okay, I made some progress! |
Beta Was this translation helpful? Give feedback.
In general, Statiq Web is structured in a way that most of the pipeline and module stuff (at least creating or editing them yourself) is abstracted away from you (much like every other static site generator - I.e. it's not common to crack open Jekyll to change how it works). That said, the internals are there for use when the default set of features doesn't satisfy. In this case though, it sounds like you can probably get by with the built-in features of Statiq Web.
Hopefully you've been able to get a boilerplate up and running by following the quick start. At that point you should be able to generate a site (a mostly empty one, but still) by calling
dotnet run
on the command line. Have y…