Write static sites with pure Nix, and nothing but pure Nix.
The concept of building a website entirely with Nix might sound unconventional, but the niXhtml project has turned this notion into a reality. It's a unique approach for those who have a fondness for functional programming and want to experiment with generating XHTML documents through Nix code. With some customization capabilities, it allows enthusiasts to explore the boundary where coding meets creativity, creating a tailored web experience.
This solution seems to strike a balance between the strange and the innovative. While the lure of constructing a website using just Nix can be daunting, the potential rewards include a deeper understanding of your tools and an opportunity to embrace a minimalistic, code-driven approach to web design.
Single-page Generation: The makePage function allows users to create a standalone XHTML document directly from Nix code, providing a straightforward way to build static pages.
Multi-page Functionality: Utilize makeSite, a convenient wrapper function that simplifies the process for creating multiple pages, reducing the complexity of managing several individual documents.
Lightweight & Minimal: The project intentionally avoids relying on nixpkgs, ensuring a fast and minimal setup that doesn't burden users with unnecessary dependencies.
Custom XHTML Structure: Offers special keys to define HTML attributes and content types, such as raw text and comments, giving developers the flexibility to structure their XHTML uniquely.
CSS and JS Support: While the primary focus is Nix, this project does support the inclusion of CSS and JavaScript, allowing for a more dynamic web presence if desired.
API Exploration: Provides access to the source functions within the ./lib, inviting users to dig deeper into the code and even contribute to documentation, promoting community involvement.
CI/CD Integration: The option to use the --json feature helps streamline workflows in CI/CD environments, making integration on platforms like NixOS easier and more efficient.