add favicons to every page

This commit is contained in:
tristan 2024-01-01 08:10:32 +00:00
parent 30ffa6c9b3
commit d723140f84
6 changed files with 129 additions and 32 deletions

View file

@ -14,8 +14,8 @@ in rec {
else if builtins.isList elem then
builtins.toString (map toHTML elem)
else
"<${elem.tag} ${writeAttrs elem.attrs}>${
toHTML elem.child
"<${elem.tag} ${writeAttrs elem.attrs or { }}>${
toHTML elem.child or ""
}</${elem.tag}>";
writeAttrs = attrs:
@ -30,11 +30,13 @@ in rec {
tag = tag: {
inherit tag;
__toString = self: toString (self { } "");
__functor = self: attrs:
if !(builtins.isAttrs attrs) then
throw "HTML tag requires attribute set"
else {
inherit tag attrs;
__toString = self: toString (self "");
__functor = self: child:
if !(isTag child) then
throw "tag child must be tag, list, or string, got ${