Fediversity/website
2024-11-13 15:47:12 +01:00
..
assets remove all the junk 2024-11-13 15:47:12 +01:00
content render content via structured DOM representation 2024-11-13 15:47:12 +01:00
content_ move more content 2024-11-13 15:47:12 +01:00
images Add 'website/' from commit 'd208ee83f80467e25c662b4680ed2d6161d88d9e' 2024-10-07 11:53:11 +02:00
layouts Add 'website/' from commit 'd208ee83f80467e25c662b4680ed2d6161d88d9e' 2024-10-07 11:53:11 +02:00
npins PoC: build site from nix files 2024-11-13 15:47:12 +01:00
presentation fix module for <link> and <base> 2024-11-13 15:47:12 +01:00
structure render content via structured DOM representation 2024-11-13 15:47:12 +01:00
.gitignore PoC: build site from nix files 2024-11-13 15:47:12 +01:00
default.nix add README 2024-11-13 15:47:12 +01:00
lib.nix add more string processing helpers 2024-11-13 15:47:12 +01:00
README.md add README 2024-11-13 15:47:12 +01:00
shell.nix PoC: build site from nix files 2024-11-13 15:47:12 +01:00

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

  • Install Nix

  • Set up direnv

  • 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

    Content of the web site is managed here. The entry point is content/default.nix and is built to correspond to index.html in the result. All other content sources are automatically included in imports, and can be accessed though the config module argument.

  • structure

    Definitions of content data structures, such as pages, articles, menus, collections, etc.

  • presentation

    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.

  • default.nix

    Entry point for building the project. This is where content, structure, and presentation are wired up.

  • shell.nix

    Convenience wrapper to enable running nix-shell without arguments.

  • lib.nix

    Reusable convenience functions. Also exposed under the lib attribute in default.nix.

  • npins

    Dependencies, managed with npins.

  • README.md

    This file.