html.nix/examples/serve.nix

28 lines
388 B
Nix
Raw Normal View History

2022-07-30 12:42:09 +03:00
{
tags,
pkgs,
}:
with pkgs.htmlNix; let
index = with tags;
html [
(body [
(p "Hello world!")
2021-05-15 21:29:30 +03:00
(mkLink "./ex.html" "say bye")
])
];
ex = with tags;
html [
(body [
(p "Bye world!")
2021-05-15 21:29:30 +03:00
(mkLink "./index.html" "go back")
])
];
2021-05-15 04:15:00 +03:00
2022-07-30 12:42:09 +03:00
site = {
"index.html" = index;
"ex.html" = ex;
};
in
2022-07-30 12:42:09 +03:00
mkServeFromSite site