refactor start page for readability

This commit is contained in:
Valentin Gagarin 2024-11-20 01:09:02 +01:00
parent 18b03924ad
commit ecb9996718
2 changed files with 47 additions and 47 deletions

View file

@ -27,23 +27,8 @@ in
{ href = "${link cfg.assets."index.css"}"; }
];
body.content =
let
prev-content = prev.html.body.content;
to-section = { heading, body, attrs ? { } }: {
section = {
heading.content = heading;
inherit attrs;
content = [
(cfg.templates.html.markdown {
name = "${config.name}-${lib.slug heading}";
inherit body;
})
];
};
};
in
[
(lib.head prev-content) # header
(lib.head prev.html.body.content)
{
section = {
attrs = { };
@ -52,42 +37,58 @@ in
(cfg.templates.html.markdown { inherit (config) name body; })
]
++
(map to-section [
{
heading = "Fediversity grants";
body = ''
${pages.grants.summary}
(
let
to-section = { heading, body, attrs ? { } }: {
section = {
heading.content = heading;
inherit attrs;
content = [
(cfg.templates.html.markdown {
name = "${config.name}-${lib.slug heading}";
inherit body;
})
];
};
};
in
map to-section [
{
heading = "Fediversity grants";
body = ''
${pages.grants.summary}
[Learn more about Fediversity grants](${link pages.grants})
'';
}
{
heading = "Consortium";
body = ''
The Consortium behind the Fediversity project is a cooperation between NLnet, Open Internet Discourse Foundation, NORDUnet and Tweag.
[Learn more about Fediversity grants](${link pages.grants})
'';
}
{
heading = "Consortium";
body = ''
The Consortium behind the Fediversity project is a cooperation between NLnet, Open Internet Discourse Foundation, NORDUnet and Tweag.
${toString (map (partner: ''
### ${partner.title}
${toString (map (partner: ''
### ${partner.title}
${partner.summary}
${partner.summary}
[Read more about ${partner.title}](${link partner})
'') (with pages; [ nlnet oid tweag nordunet ]))}
'';
}
{
heading = "Fediverse explained";
body = ''
${toString (map (role: ''
### ${role.title}
[Read more about ${partner.title}](${link partner})
'') (with pages; [ nlnet oid tweag nordunet ]))}
'';
}
{
heading = "Fediverse explained";
body = ''
${toString (map (role: ''
### ${role.title}
${role.summary}
${role.summary}
[Read more about ${role.title}](${link role})
'') (with pages; [ individuals developers european-commission ]))}
'';
}
]);
[Read more about ${role.title}](${link role})
'') (with pages; [ individuals developers european-commission ]))}
'';
}
]
);
};
}
]

View file

@ -505,7 +505,6 @@ let
else baseType.merge loc (map (p: p.def // { value = p.processed; }) processed);
};
in
# HACK: bail out for now
with-section-constraints
# TODO: find a reasonable cut-off for where to place raw content
(listOf (either str (attrTag categories.flow)));