refactor(web/blog): Configurable blog name and footer

Required for actually using this generically for the TVL blog.

Change-Id: I92d8d10341f9ab4f92c90f7976be261b3255a0f0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3768
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2021-11-02 14:34:20 +01:00 committed by tazjin
parent e99d8510d7
commit bbf92dcdea
3 changed files with 29 additions and 25 deletions

View file

@ -4,6 +4,20 @@ with depot.nix.yants;
let
inherit (builtins) hasAttr filter;
blogConfig = {
name = "tazjin's blog";
footer = ''
<p class="footer">
<a class="uncoloured-link" href="https://tazj.in">homepage</a>
|
<a class="uncoloured-link" href="https://cs.tvl.fyi/">code</a>
</p>
<p class="lod">_</p>
'';
};
inherit (depot.web.blog) post includePost renderPost;
posts = filter includePost (list post (import ./posts.nix));
@ -12,7 +26,7 @@ let
mkdir -p $out
${lib.concatStringsSep "\n" (map (post:
"cp ${renderPost post} $out/${post.key}.html"
"cp ${renderPost blogConfig post} $out/${post.key}.html"
) posts)}
'';