move site to other file, organise builder

This commit is contained in:
Tristan 2024-01-04 05:07:45 +00:00
parent 63f1c014af
commit 669fccd57e
7 changed files with 124 additions and 97 deletions

View file

@ -75,16 +75,19 @@ in
actual = processStr ''
this text **may** *or may not* contain **bold** words *inside* it.
'';
expected = [(elems.p [
"this text "
(elems.strong "may") " "
(elems.em "or may not")
" contain "
(elems.strong "bold")
" words "
(elems.em "inside")
" it."
])];
expected = [
(elems.p [
"this text "
(elems.strong "may")
" "
(elems.em "or may not")
" contain "
(elems.strong "bold")
" words "
(elems.em "inside")
" it."
])
];
asString = true;
})

30
testing/my-site.nix Normal file
View file

@ -0,0 +1,30 @@
{nixite}: let
markup = {
"index.html" = nixite.md.mdToPage ../README.md;
"my-page" = with nixite.elems; let
blue = nixite.style.component span "blue" {
style = {color = "blue";};
};
underblue = nixite.style.component blue "under" {
style = {text-decoration = "underline";};
};
in (
nixite.html.document {
head = [(title "Nixite")];
body = main [
(a "/" "Readme")
(a "/blog" "blog")
(List {} ["item 1" "item 2" "item 3"])
(p [
"check out my"
(blue "blue span")
"isn't it"
(underblue {onclick = "alert(1)";} "great!")
])
];
}
);
blog = nixite.md.readDir ./blog;
};
in
nixite.site.prepare {favicon = ./src/favicon.png;} markup