2020-08-11 00:38:07 +02:00
|
|
|
# Creates the Atom feed for my homepage.
|
2020-08-11 01:16:29 +02:00
|
|
|
{ depot, lib, pkgs, entry, pageEntries, ... }:
|
2020-08-11 00:38:07 +02:00
|
|
|
|
|
|
|
with depot.nix.yants;
|
|
|
|
|
|
|
|
let
|
2021-11-04 15:39:19 +01:00
|
|
|
inherit (builtins) map readFile;
|
2021-04-02 15:40:41 +02:00
|
|
|
inherit (lib) max singleton;
|
2020-08-11 00:38:07 +02:00
|
|
|
inherit (pkgs) writeText;
|
2021-10-19 14:00:51 +02:00
|
|
|
inherit (depot.web) blog atom-feed;
|
2020-08-11 00:38:07 +02:00
|
|
|
|
2020-08-11 01:16:29 +02:00
|
|
|
pageEntryToEntry = defun [ entry atom-feed.entry ] (e: {
|
|
|
|
id = "tazjin:${e.class}:${toString e.date}";
|
|
|
|
updated = e.date;
|
|
|
|
published = e.date;
|
|
|
|
title = e.title;
|
|
|
|
summary = e.description;
|
|
|
|
|
|
|
|
links = singleton {
|
|
|
|
rel = "alternate";
|
|
|
|
href = e.url;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2021-11-05 14:19:06 +01:00
|
|
|
allEntries = (with depot.users.tazjin.blog; map (blog.toFeedEntry config) posts)
|
2021-10-19 14:00:51 +02:00
|
|
|
++ (map pageEntryToEntry pageEntries);
|
2020-08-11 01:16:29 +02:00
|
|
|
|
2020-08-11 00:38:07 +02:00
|
|
|
feed = {
|
|
|
|
id = "https://tazj.in/";
|
|
|
|
title = "tazjin's interblag";
|
2020-08-11 01:16:29 +02:00
|
|
|
subtitle = "my posts, projects and other interesting things";
|
2020-08-11 00:38:07 +02:00
|
|
|
rights = "© 2020 tazjin";
|
|
|
|
authors = [ "tazjin" ];
|
|
|
|
|
|
|
|
links = singleton {
|
|
|
|
rel = "self";
|
|
|
|
href = "https://tazjin/feed.atom";
|
|
|
|
};
|
|
|
|
|
2021-11-04 15:39:19 +01:00
|
|
|
entries = allEntries;
|
2020-08-11 00:38:07 +02:00
|
|
|
};
|
|
|
|
in
|
|
|
|
writeText "feed.atom" (atom-feed.renderFeed feed)
|