All Projects → styx-static → Styx

styx-static / Styx

Licence: mit
Static site generator in Nix expression language.

Projects that are alternatives of or similar to Styx

hakyll-nix-template
Hakyll + Nix starter template
Stars: ✭ 20 (-79.8%)
Mutual labels:  static-site-generator, nix
Gen
Compositor JSX static site generator
Stars: ✭ 95 (-4.04%)
Mutual labels:  static-site-generator
Bauer
An Emacs+Nix IDE
Stars: ✭ 89 (-10.1%)
Mutual labels:  nix
Jekyll Rtd Theme
Just another documentation theme compatible with GitHub Pages
Stars: ✭ 92 (-7.07%)
Mutual labels:  static-site-generator
Ryosuke Gatsby Blog
Static PWA React-powered portfolio and blog built with GatsbyJS
Stars: ✭ 90 (-9.09%)
Mutual labels:  static-site-generator
Stack2nix
Generate nix expressions for Haskell projects
Stars: ✭ 93 (-6.06%)
Mutual labels:  nix
Gatsby Theme Try Ghost
A Gatsby theme to build flaring fast blogs from headless Ghost CMS
Stars: ✭ 88 (-11.11%)
Mutual labels:  static-site-generator
Log4brains
✍️ Log and publish your architecture decisions (ADR)
Stars: ✭ 98 (-1.01%)
Mutual labels:  static-site-generator
Still
A composable Elixir static site generator
Stars: ✭ 96 (-3.03%)
Mutual labels:  static-site-generator
Pre Commit Hooks.nix
Seamless integration of https://pre-commit.com git hooks with Nix.
Stars: ✭ 92 (-7.07%)
Mutual labels:  nix
Nix Processmgmt
Experimental Nix-based process management framework
Stars: ✭ 92 (-7.07%)
Mutual labels:  nix
Metalsmith React Templates
A metalsmith plugin to render files using React / Preact / JSX based templates.
Stars: ✭ 90 (-9.09%)
Mutual labels:  static-site-generator
System
My system configuration
Stars: ✭ 94 (-5.05%)
Mutual labels:  nix
Hugo Theme Basic
Basic site theme styled with minimal tachyons, syntax highlighting, and blog series configuration. 📦
Stars: ✭ 89 (-10.1%)
Mutual labels:  static-site-generator
Hydra Tutorial
Sample configuration files for setting up your own Hydra continuous integration server.
Stars: ✭ 95 (-4.04%)
Mutual labels:  nix
Rules nixpkgs
Rules for importing Nixpkgs packages into Bazel.
Stars: ✭ 88 (-11.11%)
Mutual labels:  nix
Upcast
Abandonware
Stars: ✭ 91 (-8.08%)
Mutual labels:  nix
Ghc.nix
Nix (shell) expression for working on GHC
Stars: ✭ 94 (-5.05%)
Mutual labels:  nix
Nixcloud Webservices
This nixpkgs extension, called nixcloud-webservices, focuses on ease of deployment of web-related technologies.
Stars: ✭ 98 (-1.01%)
Mutual labels:  nix
Nopress
A collection of CMSs and Static Site Generators.
Stars: ✭ 96 (-3.03%)
Mutual labels:  static-site-generator

Build Status

Styx

The purely functional static site generator in Nix expression language.

Features

Among others, styx have the following features:

Easy to install

Styx has no other dependency than nix, if nix is installed, nix-env -iA styx is all that is required to install styx.

Multiple content support

Styx support content in Markdown, AsciiDoc and nix format. Styx also extends AsciiDoc and Markdown with custom operators that can split a single markup file into many pages.

Embedded nix

Nix can be embedded in markup files!

Handling of sass/scss

Upon site rendering, styx will automatically convert SASS and SCSS files.

Template framework

The generic-template theme provides a template framework that can be leveraged to easily create new themes or sites. Thank to this a theme like Hyde consists only in about 120 lines of nix templates.

Configuration interface

Styx sites use a configuration interface à la NixOS modules. Every configuration declaration is type-checked, and documentation can be generated from that interface.

Linkcheck

Linkcheck functionality is available out of the box, just run styx linkcheck to run linkchecker on a site.

Themes

Styx supports themes. Multiple themes can be used, mixed and extended at the same time. This makes it very easy to adapt an existing theme. Official themes can also be used without any implicit installation, declaring the used theme(s) in site.nix is enough!

Documentation

Styx embeds its complete documentation that can be viewed at any time by running styx doc. A very unique feature of styx is that it can generate the documentation for a site with the styx site-doc.

Install

Use nix-env to install styx, or nix-shell to just test without installing it:

$ nix-env -iA styx
$ styx --help
$ nix-shell -p styx
$ styx --help

The version you will get will depend on the version of nixpkgs used. To get the latest stable release without relying on nixpkgs:

$ nix-env -i $(nix-build https://github.com/styx-static/styx/archive/latest.tar.gz)
$ styx --help

or

$ nix-shell -p $(nix-build https://github.com/styx-static/styx/archive/latest.tar.gz)
$ styx --help

Examples

The official styx site is an example of a basic software site with release news. It has some interesting features like:

  • generating the documentation for every version of styx
  • generating a page for every official theme

See site.nix for implementation details.

As a Nix laboratory

This repository is also a playground for more exotic nix usages and experiments:

  • derivation.nix is the main builder for styx, it builds the command line interface, the library, styx themes and the documentation.

  • script/run-tests is a thin wrapper to nix-build that will run library and functionality tests.

  • Library functions and theme templates use special functions (documentedFunction and documentedTemplate) that allow automatically generating documentation and tests. The code used to generate tests from documentedFunctions can be found in tests/lib.nix. Library function tests can print a coverage or a report (with pretty printing):

    $ cat $(nix-build --no-out-link -A coverage tests/lib.nix)
    $ cat $(nix-build --no-out-link -A report tests/lib.nix)
    
  • scripts/library-doc.nix is a nix expression that generate an AsciiDoc documentation from the library documentedFunctions (example).

  • scripts/themes-doc.nix and src/nix/site-doc.nix are nix expressions that automatically generate documentation for styx themes, including configuration interface and templates (example). This feature is leveraged in the styx site-doc command to dynamically generate the documentation for a site according to used themes.

  • lib.prettyNix is a pure nix function that pretty print nix expressions.

  • parsimonious is used to do some voodoo on markup files to turn them into valid nix expressions, so nix expressions can be embedded in Markdown or AsciiDoc.

  • styx propagatedBuildInputs are taken advantage in lib.data conversion functions like markupToHtml.

Links

Contributing

See contributing.md.

Feedback

Any question or issue should be posted in the github issue tracker. Themes and features requests are welcome! And please let me know if you happen to run a site on styx!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].