Compare commits

..

6 commits

Author SHA1 Message Date
Valentin Gagarin 0cadcb69bb add todo concerning palpable content 2024-11-09 18:33:29 +01:00
Valentin Gagarin 215d531209 list all news articles on a separate page 2024-11-09 18:33:29 +01:00
Valentin Gagarin 738106342c add past events and list them on a page 2024-11-09 04:02:45 +01:00
Valentin Gagarin 2257d5afcb add event content type 2024-11-09 03:45:20 +01:00
Valentin Gagarin 8fc85c9c85 implement definition lists with dl, dt, dd 2024-11-09 03:45:02 +01:00
Valentin Gagarin 59e2e422af make template overrides take final and prev 2024-11-09 01:52:20 +01:00
20 changed files with 344 additions and 112 deletions

View file

@ -7,16 +7,15 @@ in
imports = lib.nixFiles ./.; imports = lib.nixFiles ./.;
collections.news.type = cfg.content-types.article; collections.news.type = cfg.content-types.article;
collections.events.type = cfg.content-types.event;
pages.index = { config, link, ... }: { pages.index = { config, link, ... }: {
title = "Fediversity"; title = "Welcome to the Fediversity project";
description = "Fediversity web site"; description = "Fediversity web site";
summary = '' summary = ''
This web site hosts up-to-date information about the the NGI Zero Fediversity project. This web site hosts up-to-date information about the the NGI Zero Fediversity project.
''; '';
body = '' body = ''
# Welcome to the Fediversity project
${pages.fediversity.summary} ${pages.fediversity.summary}
[Learn more about Fediversity](${link pages.fediversity}) [Learn more about Fediversity](${link pages.fediversity})
@ -59,13 +58,20 @@ in
- ${article.date} [${article.title}](${link article}) - ${article.date} [${article.title}](${link article})
'') sorted) '') 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 { outputs.html = (cfg.templates.html.page config).override {
html.body.content = lib.mkForce [ html.head.title.text = "Fediversity";
# don't show the page title as a heading
(cfg.menus.main.outputs.html config)
(cfg.templates.html.markdown { inherit (config) name body; })
];
}; };
}; };
} }

16
content/events.nix Normal file
View file

@ -0,0 +1,16 @@
{ config, lib, ... }:
{
pages.events = { link, ... }: rec {
title = "Events";
description = "Events related to the Fediverse and NixOS";
summary = description;
body =
with lib;
let
events = map (event: "- [${event.start-date} ${event.title}](${link event})") config.collections.events.entry;
in
''
${join "\n" events}
'';
};
}

View file

@ -0,0 +1,24 @@
{ ... }:
{
collections.events.entry = { ... }: {
title = "OW2con 2024";
description = "OW2con is the annual European open source conference in Paris";
start-date = "2024-06-11";
end-date = "2024-06-12";
start-time = "09:00";
end-time = "18:00";
location = "Paris-Chatillon";
body = ''
OW2con is the European open source conference organized by OW2.
An international meeting of developpers, IT companies, academics and non-profit organizations, OW2con brings together the entire open source community, during two days of presentations ranging from tech topics to business and ethical issues of open source.
It also offers a unique opportunity to establish contact with peers through friendly networking sessions.
OW2con is [open](https://www.ngi.eu/event/open-source-community-annual-conference-2024/) to all, the event is free and all sessions are held in English.
The OW2con24 call for presentations is open.
This year we are giving the highlight on the theme of open source funding:
What are the current solutions for innovators, start-ups or ISVs to finance their development?
Private or public financing?
Are national and European public policies up to the challenges?
'';
};
}

View file

@ -0,0 +1,18 @@
{ ... }:
{
collections.events.entry = { ... }: {
title = "PublicSpaces Conference 2024";
description = "A conference by PublicSpaces, Taking Back the Internet.";
start-date = "2024-06-06";
end-date = "2024-06-07";
start-time = "09:00";
end-time = "18:00";
location = "Pakhuis de Zwijger - Amsterdam";
body = ''
On June 6th and 7th, PublicSpaces and Waag Futurelab proudly present the fourth edition of the PublicSpaces conference under the theme 'Empowering the Internet'.
Held at Pakhuis de Zwijger, this two-day event will feature panels, keynotes, roundtable discussions, lectures, as well as art and cultural showcases, all aimed at collectively shaping the rules for a more inclusive internet.
Join us as we navigate towards a digital landscape where everyone has a voice.
For more information, check out the [website](https://publicspaces.net/2024/02/01/save-the-date-publicspaces-conferentie-2024/)
'';
};
}

View file

@ -0,0 +1,25 @@
{ ... }:
{
collections.events.entry = { ... }: {
title = "State of the Internet 2024";
description = "The State of the Internet 2024 by Waag";
start-date = "2024-05-16";
end-date = "2024-05-16";
start-time = "18:00";
end-time = "20:00";
location = "OBA Oosterdok - Amsterdam";
body = ''
Join us at the State of the Internet 2024, where Waag Futurelab, alongside the Municipality of Amsterdam and the OBA, delves into the depths of the online realm.
Featuring Kim van Sparrentak, Member of the European Parliament, discussing Europe's efforts to regulate Big Tech and enhance digital rights.
Explore the impact of pivotal European laws like the GDPR and AI Act while celebrating 30 years of Waag Futurelab's dedication to democratizing technology access for all.
The event takes place at:
OBA Oosterdok <br>
Oosterdokskade 143 <br>
1011 DK Amsterdam
Registration available [here](https://waag.org/nl/event/de-staat-van-het-internet-2024-met-kim-van-sparrentak/).
'';
};
}

View file

@ -19,18 +19,8 @@ in
} }
{ page = pages.fediversity; } { page = pages.fediversity; }
{ page = pages.grants; } { page = pages.grants; }
{ { page = pages.news; }
menu.label = "News"; { page = pages.events; }
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);
}
]; ];
}; };
} }

24
content/news.nix Normal file
View file

@ -0,0 +1,24 @@
{ config, lib, ... }:
{
pages.news = { link, ... }: rec {
title = "News";
description = "News about Fediversity";
summary = description;
body =
with lib;
let
news = map
(article: ''
## [${article.title}](${link article})
${article.date} by ${article.author}
${article.summary}
'')
config.collections.news.entry;
in
''
${join "\n\n" news}
'';
};
}

View file

@ -5,6 +5,9 @@
description = "Report from the NORDUnet Conference 2024"; description = "Report from the NORDUnet Conference 2024";
date = "2024-09-17"; date = "2024-09-17";
author = "Laurens Hof"; author = "Laurens Hof";
summary = ''
Fediversity was represented in Bergen at the Nordunet Conference for 2024, with both the Internet Discourse Foundation and Nordunet themselves being present.
'';
body = '' body = ''
Fediversity was represented in Bergen at the Nordunet Conference for 2024, with both the Internet Discourse Foundation and Nordunet themselves being present. This was a great opportunity for the different organisations in the consortium to meet with each other and exchange ideas. Fediversity was represented in Bergen at the Nordunet Conference for 2024, with both the Internet Discourse Foundation and Nordunet themselves being present. This was a great opportunity for the different organisations in the consortium to meet with each other and exchange ideas.

View file

@ -5,6 +5,9 @@
description = "The Fediversity project has officially been announced"; description = "The Fediversity project has officially been announced";
date = "2024-01-01"; date = "2024-01-01";
author = "Laurens Hof"; author = "Laurens Hof";
summary = ''
We are pleased to introduce the launch of our new website dedicated to the Fediversity project.
'';
body = '' body = ''
The Consortium behind the Fediversity project announces that the project has officially been started. NLnet, Tweag, NorduNet and the Open Internet Discourse Foundation are working together to build a new service for cloud hosters. The Consortium behind the Fediversity project announces that the project has officially been started. NLnet, Tweag, NorduNet and the Open Internet Discourse Foundation are working together to build a new service for cloud hosters.

View file

@ -5,6 +5,9 @@
description = "Report from the PublicSpaces Conference 2024 - 'Take Back the Internet'"; description = "Report from the PublicSpaces Conference 2024 - 'Take Back the Internet'";
date = "2024-07-30"; date = "2024-07-30";
author = "Laurens Hof"; author = "Laurens Hof";
summary = ''
PublicSpaces and Waag Futurelabs recently held their yearly conference in Amsterdam, titled Taking Back the Internet
'';
body = '' body = ''
PublicSpaces and Waag Futurelabs recently held their yearly conference in Amsterdam, titled 'Taking Back the Internet'. PublicSpaces is a network of public organisations fighting for an internet based on public values. The Fediversity Project attended, to share ideas, and learn more about how people and organisations think about an ethical internet. If you are interested, you can view all sessions [here](https://conference.publicspaces.net/en/archive/pubconf2024) (hosted on PeerTube!). PublicSpaces and Waag Futurelabs recently held their yearly conference in Amsterdam, titled 'Taking Back the Internet'. PublicSpaces is a network of public organisations fighting for an internet based on public values. The Fediversity Project attended, to share ideas, and learn more about how people and organisations think about an ethical internet. If you are interested, you can view all sessions [here](https://conference.publicspaces.net/en/archive/pubconf2024) (hosted on PeerTube!).

View file

@ -5,6 +5,9 @@
description = "Fediversity tech session - NixOS and Kubernetes"; description = "Fediversity tech session - NixOS and Kubernetes";
date = "2024-08-05"; date = "2024-08-05";
author = "Laurens Hof"; author = "Laurens Hof";
summary = ''
Recently Fediversity hosted a tech session on NixOS and Kubernetes. We invited people within the community to discuss some design considerations of the Fediversity project with us.
'';
body = '' body = ''
Recently Fediversity hosted a tech session on NixOS and Kubernetes. We invited people within the community to discuss some design considerations of the Fediversity project with us. Recently Fediversity hosted a tech session on NixOS and Kubernetes. We invited people within the community to discuss some design considerations of the Fediversity project with us.

View file

@ -5,6 +5,9 @@
description = "Announcing our new website for the Fediversity project"; description = "Announcing our new website for the Fediversity project";
date = "2024-05-15"; date = "2024-05-15";
author = "Laurens Hof"; author = "Laurens Hof";
summary = ''
We are pleased to introduce the launch of our new website dedicated to the Fediversity project.
'';
body = '' body = ''
We are pleased to introduce the launch of our new website dedicated to the Fediversity project. We are pleased to introduce the launch of our new website dedicated to the Fediversity project.

View file

@ -1,5 +0,0 @@
---
title: "Events"
meta_title: "Events"
description: "Events related to the fediverse and NixOS."
---

View file

@ -1,18 +0,0 @@
---
title: "OW2con 2024"
meta_title: ""
description: "OW2con is the annual European open source conference in Paris"
date: 2024-05-11T09:00:00Z
categories: ["Event", "Conference"]
image: "/images/image-placeholder.png"
author: "Laurens Hof"
draft: false
date_start: 2024-06-11
date_end: 2024-06-12
datetime_start: 2024-06-11 09:00
datetime_end: 2024-06-12 18:00
location: Paris-Chatillon
---
OW2con is the European open source conference organized by OW2. An international meeting of developpers, IT companies, academics and non-profit organizations, OW2con brings together the entire open source community, during two days of presentations ranging from tech topics to business and ethical issues of open source. It also offers a unique opportunity to establish contact with peers through friendly networking sessions. OW2con is [open](https://www.ngi.eu/event/open-source-community-annual-conference-2024/) to all, the event is free and all sessions are held in English.
The OW2con24 call for presentations is open. This year we are giving the highlight on the theme of open source funding: what are the current solutions for innovators, start-ups or ISVs to finance their development? private or public financing? Are national and European public policies up to the challenges?

View file

@ -1,18 +0,0 @@
---
title: "PublicSpaces Conference 2024"
meta_title: ""
date: 2024-05-11T14:00:00+02:00
description: "A conference by PublicSpaces, Taking Back the Internet."
categories: ["Event", "Conference"]
image: "/images/image-placeholder.png"
author: "Laurens Hof"
draft: false
date_start: 2024-06-06
date_end: 2024-06-07
datetime_start: 2024-06-06 09:00
datetime_end: 2024-06-07 18:00
location: Pakhuis de Zwijger - Amsterdam
---
w
On June 6th and 7th, PublicSpaces and Waag Futurelab proudly present the fourth edition of the PublicSpaces conference under the theme 'Empowering the Internet'. Held at Pakhuis de Zwijger, this two-day event will feature panels, keynotes, roundtable discussions, lectures, as well as art and cultural showcases, all aimed at collectively shaping the rules for a more inclusive internet. Join us as we navigate towards a digital landscape where everyone has a voice. For more information, check out the [website](https://publicspaces.net/2024/02/01/save-the-date-publicspaces-conferentie-2024/)

View file

@ -1,25 +0,0 @@
---
title: "State of the Internet 2024"
meta_title: ""
description: "The State of the Internet 2024 by Waag"
date: 2024-04-10T16:00:00Z
image: "/images/image-placeholder.png"
categories: ["Event", "Webinar"]
author: "Laurens Hof"
draft: false
date_start: 2024-05-16
date_end: 2024-05-16
datetime_start: 2024-05-16 18:00
datetime_end: 2024-05-16 20:00
location: OBA Oosterdok - Amsterdam
---
Join us at the State of the Internet 2024, where Waag Futurelab, alongside the Municipality of Amsterdam and the OBA, delves into the depths of the online realm. Featuring Kim van Sparrentak, Member of the European Parliament, discussing Europe's efforts to regulate Big Tech and enhance digital rights. Explore the impact of pivotal European laws like the GDPR and AI Act while celebrating 30 years of Waag Futurelab's dedication to democratizing technology access for all.
The event takes place at:
OBA Oosterdok <br>
Oosterdokskade 143 <br>
1011 DK Amsterdam
Registration available [here](https://waag.org/nl/event/de-staat-van-het-internet-2024-met-kim-van-sparrentak/)

View file

@ -8,7 +8,11 @@ rec {
result // { result // {
override = new: override = new:
let let
base' = lib.recursiveUpdate base new; base' =
if lib.isFunction new
then lib.recursiveUpdate base (new base' base)
else
lib.recursiveUpdate base new;
result' = g base'; result' = g base';
in in
result' // { result' // {

View file

@ -55,6 +55,7 @@ let
(category: (category:
(mapAttrs (_: e: mkOption { type = submodule e; }) (mapAttrs (_: e: mkOption { type = submodule e; })
# HACK: don't evaluate the submodule types, just grab the config directly # HACK: don't evaluate the submodule types, just grab the config directly
# TODO: we may want to do this properly and loop `categories` through the top-level `config`
(filterAttrs (_: e: elem category (e { name = "dummy"; config = { }; }).config.categories) elements)) (filterAttrs (_: e: elem category (e { name = "dummy"; config = { }; }).config.categories) elements))
); );
@ -521,6 +522,103 @@ let
config.categories = [ "flow" "palpable" ]; config.categories = [ "flow" "palpable" ];
config.__toString = self: print-element name self.attrs (toString self.content); config.__toString = self: print-element name self.attrs (toString self.content);
}; };
dl = { config, name, ... }: {
imports = [ element ];
options = {
attrs = mkAttrs { };
content = mkOption {
type = with types; listOf (submodule ({ ... }: {
options = {
# TODO: wrap in `<div>` if set
div.attrs = mkOption {
type = with types; nullOr (submodule { options = global-attrs; });
default = null;
};
before = mkOption {
type = with types; listOf (attrTag categories.scripting);
default = [ ];
};
terms = mkOption {
type = with types; nonEmptyListOf (submodule dt);
};
between = mkOption {
type = with types; listOf (attrTag categories.scripting);
default = [ ];
};
descriptions = mkOption {
type = with types; nonEmptyListOf (submodule dd);
};
after = mkOption {
type = with types; listOf (attrTag categories.scripting);
default = [ ];
};
};
}));
};
};
# XXX: here we can't express the spec requirement that `dl` is palpable if the list of term-description-pairs is nonempty.
# the reason is that we have to specify a child's *type* in the parent, but being palpable is a property of the value in this case.
# and while the module system does have some dependent typing capabilities, we can't say "the type is X but only if its value has property Y".
# but since the "palpable" category isn't used in any structural requirement in the spec, this is not a loss of fidelity on our side.
# TODO: the whole notion of content categories may be a red herring for this implementation after all, reconsider it.
# it does help to concisely express type constraints on an element's children, but it seems that most of the categories in the spec can be ignored entirely in this implementation.
# the cleanup task would be to identify which categories are really helpful, and document the rationale for using that mechanism as well as the specific choice of categories to keep.
config.categories = [ "flow" ];
config.__toString = self:
with lib;
let
content = map
(entry:
let
list = squash ''
${join "\n" entry.before}
${join "\n" entry.terms}
${join "\n" entry.between}
${join "\n" entry.descriptions}
${join "\n" entry.after}
'';
in
if !isNull entry.div.attrs
then print-element "div" entry.div.attrs list
else list
)
self.content;
in
print-element name self.attrs (join "\n" content);
};
dt = { config, ... }: {
imports = [ element ];
options = {
attrs = mkAttrs { };
dt = mkOption {
type = with types; either str (submodule (attrTag (
# TODO: test
with lib; removeAttrs
(filterAttrs
(name: value: ! any (c: elem c [ "sectioning" "heading" ]) value.categories)
categories.flow
)
[ "header" "footer" ]
)));
};
};
config.categories = [ ];
config.__toString = self: print-element "dt" self.attrs self.dt;
};
dd = { config, ... }: {
imports = [ element ];
options = {
attrs = mkAttrs { };
dd = mkOption {
type = with types; either str (submodule (attrTag categories.flow));
};
};
config.categories = [ ];
config.__toString = self: print-element "dd" self.attrs self.dd;
};
}; };
in in
{ {

View file

@ -1,7 +1,6 @@
{ config, options, lib, ... }: { config, options, lib, ... }:
let let
inherit (lib) inherit (lib) mkOption
mkOption
types types
; ;
cfg = config; cfg = config;
@ -27,28 +26,26 @@ in
}; };
}; };
config.name = lib.slug config.title; config.name = lib.slug config.title;
config.outputs.html = lib.mkForce ((cfg.templates.html.page config).override { config.outputs.html = lib.mkForce
html = { ((cfg.templates.html.page config).override (final: prev: {
# TODO: make authors always a list html = {
head.meta.authors = if lib.isList config.author then config.author else [ config.author ]; # TODO: make authors always a list
body.content = lib.mkForce [ head.meta.authors = if lib.isList config.author then config.author else [ config.author ];
(cfg.menus.main.outputs.html config) body.content = with lib; map
{ (e:
section = { if isAttrs e && e ? section
heading = { then
# TODO: i18n support recursiveUpdate e
# TODO: structured dates {
before = [{ p.content = "Published ${config.date}"; }]; section.heading = {
content = config.title; before = [{ p.content = "Published ${config.date}"; }];
after = [{ p.content = "Written by ${config.author}"; }]; after = [{ p.content = "Written by ${config.author}"; }];
}; };
content = [ }
(cfg.templates.html.markdown { inherit (config) name body; }) else e
]; )
}; prev.html.body.content;
} };
]; }));
};
});
}; };
} }

81
structure/event.nix Normal file
View file

@ -0,0 +1,81 @@
{ config, options, lib, ... }:
let
inherit (lib)
mkOption
types
;
cfg = config;
in
{
content-types.event = { config, collection, ... }: {
imports = [ cfg.content-types.page ];
options = {
collection = mkOption {
description = "Collection this event belongs to";
type = options.collections.type.nestedTypes.elemType;
default = collection;
};
start-date = mkOption {
description = "Start date of the event";
type = with types; str;
};
start-time = mkOption {
description = "Start time of the event";
type = with types; str;
default = null;
};
end-date = mkOption {
description = "End date of the event";
type = with types; str;
default = null;
};
end-time = mkOption {
description = "End time of the event";
type = with types; str;
default = null;
};
location = mkOption {
description = "Location of the event";
type = with types; str;
};
};
config.name = lib.slug config.title;
config.summary = lib.mkDefault config.description;
config.outputs.html = lib.mkForce
((cfg.templates.html.page config).override (final: prev: {
html.body.content = with lib; map
(e:
if isAttrs e && e ? section
then
recursiveUpdate e
{
section.content = [
{
dl.content = [
{
terms = [{ dt = "Location"; }];
descriptions = [{ dd = config.location; }];
}
{
terms = [{ dt = "Start"; }];
descriptions = [{
dd = config.start-date + lib.optionalString (!isNull config.start-time) " ${config.start-time}";
}];
}
] ++ lib.optional (!isNull config.end-date) {
terms = [{ dt = "End"; }];
descriptions = [{
dd = config.end-date + lib.optionalString (!isNull config.end-time) " ${config.end-time}";
}];
};
}
]
++ e.section.content;
}
else e
)
prev.html.body.content;
}));
};
}