Compare commits

...

2 commits

Author SHA1 Message Date
Valentin Gagarin 72fe2e9639 more scalable imports
that directory will only grow
2024-10-12 01:49:27 +02:00
Valentin Gagarin a007c5ff7d add TODOs 2024-10-12 01:49:18 +02:00
2 changed files with 10 additions and 9 deletions

View file

@ -3,15 +3,7 @@ let
inherit (config) pages;
in
{
imports = [
./grants.nix
./fediversity.nix
]
++
lib.fileset.toList ./partners
++
lib.fileset.toList ./news
;
imports = with lib.fileset; toList (difference (fileFilter ({ hasExt, ... }: hasExt "nix") ./.) ./default.nix);
pages.index = {
title = "Fediversity";

View file

@ -46,6 +46,11 @@ let
'';
type = with types; nonEmptyListOf str;
};
link = mkOption {
description = "Helper function for transparent linking to other pages";
type = with types; functionTo str;
default = target: "TODO: compute the relative path based on `locations`";
};
outPath = mkOption {
description = ''
Location of the page, used for transparently creating links
@ -128,6 +133,7 @@ in
'';
type = with types; attrsOf (functionTo (functionTo options.files.type));
};
# TODO: split out templates and all related helper junk into `../presentation`
config.templates =
let
commonmark = name: markdown: pkgs.runCommand "${name}.html"
@ -140,6 +146,9 @@ in
{
page = lib.mkDefault (config: page: {
# TODO: create static redirects from `tail page.locations`
# TODO: reconsider using `page.outPath` and what to put into `locations`.
# maybe we can avoid having ".html" suffixes there.
# since templates can output multiple files, `html` is merely one of many things we *could* produce.
${page.outPath} = builtins.toFile "${page.name}.html" ''
<html>
<head>