61 lines
1.9 KiB
Nix
61 lines
1.9 KiB
Nix
{
|
|
description = "A site in nix?";
|
|
|
|
outputs = { self, nixpkgs, }:
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = import nixpkgs { inherit system; };
|
|
nixite = import ./nixite/. { inherit pkgs; };
|
|
in nixite // {
|
|
packages.${system} = {
|
|
raw = nixite.mkSite (let
|
|
readme = _: {
|
|
type = "page";
|
|
name = "readme";
|
|
content = nixite.md.mdToPage ./README.md;
|
|
};
|
|
markup = {
|
|
"test" = with nixite.elems;
|
|
let
|
|
blue = nixite.style.tag "span" "blue" {
|
|
style = { color = "blue"; };
|
|
};
|
|
underblue = nixite.style.extend blue "under" {
|
|
style = { text-decoration = "underline"; };
|
|
};
|
|
in (Doc { } [
|
|
[ (title { } "Nixite") ]
|
|
(main { } [
|
|
(a "/readme" "Readme")
|
|
(a "/blog" "blog")
|
|
(List { } [ "item 1" "item 2" "item 3" ])
|
|
(p { } [
|
|
"check out my"
|
|
(blue "blue span")
|
|
"isn't it"
|
|
(underblue "great!")
|
|
])
|
|
])
|
|
]);
|
|
blog = nixite.md.readDir ./testing/blog;
|
|
"index.html" = (readme { }).content;
|
|
};
|
|
styles = nixite.site.getStyles markup;
|
|
site = (nixite.site.extractPaths (nixite.site.applyStyle styles
|
|
(nixite.site.applyFavicon ./testing/src/favicon.png markup)));
|
|
in site);
|
|
|
|
default = nixite.serve self.packages.${system}.raw;
|
|
|
|
test = let run = import ./testing/run.nix pkgs;
|
|
in run [
|
|
./testing/md.test.nix
|
|
./testing/html.test.nix
|
|
./testing/elems.test.nix
|
|
./testing/site.test.nix
|
|
./testing/style.test.nix
|
|
];
|
|
};
|
|
};
|
|
}
|