Valentin Gagarin
5ee1c8b006
this was quite a beast to tame, but it now allows putting sections anywhere in the tree without having to redundantly specify heading levels, which will be computed automatically from the nesting depth. the whole thing will also blow up if the maximum section nesting depth is exceeded, just as the spec requires - albeit with an absolutely impenetrable error message. this could in principle be improved with lots of additional machinery, but this is by far not low-hanging fruit. just don't nest your sections too much. |
||
---|---|---|
.. | ||
assets | ||
content | ||
content_ | ||
images | ||
layouts | ||
npins | ||
presentation | ||
structure | ||
.gitignore | ||
default.nix | ||
lib.nix | ||
README.md | ||
shell.nix |
Fediversity web site
This web site is built with a static site generator based on the Nix language module system. It has unique features such as:
- correct-by-construction relative links, automatic redirects for moved pages
- correct-by-construction content fields
- customisable templating and content structure, all seamlessly expressed in the Nix language
- correct-by-construction spec-compliant HTML output
- content source organisation independent of output structure
Structured content is managed through Nix expressions, and copy is written in CommonMark.
Contributing
-
Run
direnv allow
in the directory where repository is stored on your machine -
Edit any of the files, see repository layout for guidance
-
Build and view the web site
xdg-open $(nix-build -A build --no-out-link)/index.html
or
open (nix-build -A build --no-out-link)/index.html
Repository layout
-
Content of the web site is managed here. The entry point is
content/default.nix
and is built to correspond toindex.html
in the result. All other content sources are automatically included inimports
, and can be accessed though theconfig
module argument. -
Definitions of content data structures, such as pages, articles, menus, collections, etc.
-
Code specific to how the web site is rendered. In particular, it encodes the mechanism for distributing content to files, and for putting together files for the final result.
In principle, different output formats (such as RSS feeds) are possible, and would be implemented there.
-
Entry point for building the project. This is where content, structure, and presentation are wired up.
-
Convenience wrapper to enable running
nix-shell
without arguments. -
Reusable convenience functions. Also exposed under the
lib
attribute in default.nix. -
Dependencies, managed with
npins
. -
This file.