4 ms·
You’re using Nix to drive your static site generation? If so, please share more details because that sounds intriguing!
by schemescape 3y ago
You’re using Nix to drive your static site generation? If so, please share more details because that sounds intriguing!
- Jhsto 3y agoHere you go: https://juuso.dev/blogPosts/nix-as-a-static-site-generator/nix-as-a-static-site-generator.html https://juuso.dev/blogPosts/nix-as-a-static-site-generator/n...
- schemescape 3y agoWow, I ask and a blog post just appears! My initial reaction is: I should probably get around to learning about Flakes. I’m not sure I’d want each blog post to pin its templates, but it’s nice to have that choice.
- __MatrixMan__ 3y agoA flake is a function, right? Invoking `nix build` resolves its inputs and computes its outputs. So if the static site is the output, wouldn't the content have to be one of the inputs? Personally, I think I'd use two flakes, one that builds the content into something that's ready to hand-off to code, and a second one that turns it into a usable site. That way you wouldn't end up with a new input for each post, but instead would have a versioned something which represents your content all bundled together, and then the site builder consumes it as a single dependency--but conceptually it's the same. I guess I'm just saying that it's not conventional, but it's a pretty logical conclusion to reach.