Styx

Static site generator in Nix expression language.
Alternatives To Styx
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Jekyll47,28377,4972,4702 days ago146January 30, 2023194mitRuby
:globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby
Vuepress21,73297790a month ago87February 25, 2023578mitJavaScript
📝 Minimalistic Vue-powered static site generator
Eleventy15,0745535902 days ago166April 26, 2023486mitJavaScript
A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
Pelican11,7371,689111a month ago58February 09, 202290agpl-3.0Python
Static site generator that supports Markdown and reST syntax. Powered by Python.
Zola11,591
a day ago6June 19, 2017224mitRust
A fast static site generator in a single binary with everything built-in. https://www.getzola.org
Nextra8,7217316 hours ago166July 13, 2023209mitTypeScript
Simple, powerful and flexible site generation framework with everything you love from Next.js.
Pagic1,58712157 days ago8April 03, 201710mitJavaScript
A static site generator powered by Deno + React
Statiq.web1,58353 months ago79June 14, 2023192otherC#
Statiq Web is a flexible static site generator written in .NET.
Lume1,484
17 hours ago23mitTypeScript
🔥 Static site generator for Deno 🦕
Awesome Jamstack1,281
4 days ago1
Carefully curated list of awesome Jamstack resources
Alternatives To Styx
Select To Compare


Alternative Project Comparisons
Readme

Styx

Build Status

The purely functional static site generator written in the Nix expression language.

Features

Among other things, Styx has the following features:

Easy to get started

Styx has no other dependency than Nix, if Nix is installed, run the following to use Styx:

# if using flakes
$ nix shell github:styx-static/styx
# otherwise
$ nix-shell -p styx

Multiple content support

Styx supports 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 profile to install Styx, or nix shell to just test without installing it:

$ nix profile install github:styx-static/styx
$ styx --help
$ nix shell github:styx-static/styx
$ 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.

  • 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):

    ```
    $ system="$(nix eval --raw --expr "builtins.currentSystem" --impure)"
    $ nix build .#"$system"._automation.tests.lib-report && cat ./result
    $ nix build .#"$system"._automation.tests.lib-coverage && cat ./result
    ```
    
  • src/renderers/docs/library.nix is a nix expression that generate an AsciiDoc documentation from the library documentedFunctions (example).

  • src/renderers/docs/site.nix is a 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.

  • 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.

  • std is a framework to keep bigger flake projects maintainable.

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!

Popular Site Generator Projects
Popular Static Site Generator Projects
Popular Content Management Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Theme
Static Site Generator
Site Generator
Asciidoc