fix semantics: wrap content body into section

This commit is contained in:
Valentin Gagarin 2024-11-08 15:15:45 +01:00
parent 15984affec
commit c5fad394de
4 changed files with 31 additions and 9 deletions

View file

@ -36,6 +36,15 @@ rec {
packages = with pkgs; [ packages = with pkgs; [
cmark cmark
npins npins
watchexec
]; ];
shellHook = ''
cat << EOF
For incremental rebuilds:
echo watchexec -e nix "nix-build -A build"
firefox --new-tab file:///${toString ./.}/result/index.html
EOF
'';
}; };
} }

View file

@ -8,6 +8,8 @@ rec {
result // { result // {
override = new: override = new:
let let
# TODO: let overrides take the previous state as an argument
# base' = lib.recursiveUpdate base (new base);
base' = lib.recursiveUpdate base new; base' = lib.recursiveUpdate base new;
result' = g base'; result' = g base';
in in

View file

@ -31,20 +31,25 @@ in
html = { html = {
# TODO: make authors always a list # TODO: make authors always a list
head.meta.authors = if lib.isList config.author then config.author else [ config.author ]; head.meta.authors = if lib.isList config.author then config.author else [ config.author ];
head.title.text = lib.mkForce "yeah";
body.content = lib.mkForce [ body.content = lib.mkForce [
(cfg.menus.main.outputs.html config) (cfg.menus.main.outputs.html config)
{ {
section.heading = { section = {
heading = {
# TODO: i18n support # TODO: i18n support
# TODO: structured dates # TODO: structured dates
before = [{ p.content = "Published ${config.date}"; }]; before = [{ p.content = "Published ${config.date}"; }];
content = config.title; content = config.title;
after = [{ p.content = "Written by ${config.author}"; }]; after = [{ p.content = "Written by ${config.author}"; }];
}; };
} content = [
(cfg.templates.html.markdown { inherit (config) name body; }) (cfg.templates.html.markdown { inherit (config) name body; })
]; ];
}; };
}
];
};
}); });
}; };
} }

View file

@ -64,9 +64,15 @@ in
}; };
body.content = [ body.content = [
(cfg.menus.main.outputs.html page) (cfg.menus.main.outputs.html page)
{ section.heading.content = page.title; } {
section = {
heading.content = page.title;
content = [
(cfg.templates.html.markdown { inherit (page) name body; }) (cfg.templates.html.markdown { inherit (page) name body; })
]; ];
}; };
}
];
};
}); });
} }