html.nix/examples/serve.nix

23 lines
371 B
Nix
Raw Normal View History

{ 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
site = { "index.html" = index; "ex.html" = ex; };
in
2021-05-15 04:15:00 +03:00
mkServeFromSite site