fediversity.eu/content/navigation.nix
Valentin Gagarin e0bb83610f allow menu entries to be subtypes of page
with an example
2024-10-16 01:16:56 +02:00

32 lines
734 B
Nix

{ config, lib, ... }:
let
inherit (config) pages;
in
{
menus.main = {
label = "Main";
items = [
{
menu.label = "Consortium";
menu.items = map (page: { inherit page; }) (with pages; [ nlnet oid tweag nordunet ]);
}
{
menu.label = "News";
menu.items =
let
sorted = with lib; reverseList (sortOn (entry: entry.date) config.collections.news.entry);
in
map
(page: {
page = lib.recursiveUpdate page {
title = "${page.date}: ${page.title}";
};
})
(lib.take 3 sorted);
}
{ page = pages.fediversity; }
{ page = pages.grants; }
];
};
}