2024-05-22 21:55:06 +02:00
|
|
|
{
|
2024-05-25 17:16:01 +02:00
|
|
|
getEntry,
|
2024-05-22 21:55:06 +02:00
|
|
|
pkgs,
|
|
|
|
...
|
2024-05-25 17:16:01 +02:00
|
|
|
}: let
|
2024-05-22 21:55:06 +02:00
|
|
|
inherit (pkgs) lib;
|
|
|
|
inherit (lib.lists) map;
|
|
|
|
inherit (lib.strings) concatStrings;
|
|
|
|
in {
|
|
|
|
template = "base";
|
|
|
|
|
|
|
|
head = /*html*/''
|
|
|
|
<title>nte posts</title>
|
|
|
|
<link rel="stylesheet" href="/posts/index.css" />
|
|
|
|
'';
|
|
|
|
|
|
|
|
body = let
|
|
|
|
postItem = post: /*html*/''
|
|
|
|
<div class="post-item">
|
|
|
|
<div class="post-title">
|
|
|
|
<a href="/${post.file}"><h2>${post.title}</h2></a>
|
|
|
|
</div>
|
|
|
|
<h3>${post.created}</h3>
|
|
|
|
</div>
|
|
|
|
'';
|
|
|
|
in /*html*/''
|
|
|
|
<div id="posts">
|
2024-05-25 17:16:01 +02:00
|
|
|
${concatStrings (map (postFile: postItem (getEntry postFile))
|
2024-05-22 21:55:06 +02:00
|
|
|
[
|
|
|
|
./test.nix
|
|
|
|
]
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
'';
|
|
|
|
}
|