{ config, lib, ... }: let inherit (config) pages; cfg = config; in { imports = lib.nixFiles ./.; collections.news.type = cfg.content-types.article; collections.events.type = cfg.content-types.event; pages.index = { config, link, ... }: { title = "Welcome to the Fediversity project"; description = "Fediversity web site"; summary = '' This web site hosts up-to-date information about the the NGI Zero Fediversity project. ''; body = '' ${pages.fediversity.summary} [Learn more about Fediversity](${link pages.fediversity}) # Fediversity grants ${pages.grants.summary} [Learn more about Fediversity grants](${link pages.grants}) # Consortium The Consortium behind the Fediversity project is a cooperation between NLnet, Open Internet Discourse Foundation, NORDUnet and Tweag. ${toString (map (partner: '' ## ${partner.title} ${partner.summary} [Read more about ${partner.title}](${link partner}) '') (with pages; [ nlnet oid tweag nordunet ]))} # Fediverse explained ${toString (map (role: '' ## ${role.title} ${role.summary} [Read more about ${role.title}](${link role}) '') (with pages; [ individuals developers european-commission ]))} # News ${ let sorted = with lib; reverseList (sortOn (entry: entry.date) cfg.collections.news.entry); in lib.join "\n" (map (article: '' - ${article.date} [${article.title}](${link article}) '') sorted) } # Events ${ let sorted = with lib; reverseList (sortOn (entry: entry.start-date) cfg.collections.events.entry); in lib.join "\n" (map (article: '' - ${article.start-date} [${article.title}](${link article}) '') sorted) } ''; outputs.html = (cfg.templates.html.page config).override { html.head.title.text = "Fediversity"; }; }; }