refactor: some docs, refactor basic template a lil bit
This commit is contained in:
parent
5dab512a5d
commit
6d61daa842
@ -6,7 +6,10 @@ in
|
||||
htmlNix.mkServeFromSite (htmlNix.mkSiteFrom {
|
||||
inherit src;
|
||||
templater = context: pkgs.lib.pipe context [
|
||||
# Add basic template
|
||||
lib.templaters.basic
|
||||
|
||||
# Add about page
|
||||
({ site, mkPage, ... }@result: {
|
||||
site = site // {
|
||||
"about.html" = with lib.tags; mkPage [
|
||||
|
@ -10,10 +10,14 @@
|
||||
utils = import ./utils.nix;
|
||||
|
||||
lib = {
|
||||
# Convert Nix expressions to HTML
|
||||
tags = import ./tags.nix { inherit utils; };
|
||||
# Convert Nix expressions to CSS
|
||||
css = import ./css.nix { inherit utils; };
|
||||
|
||||
# Various site templaters
|
||||
templaters = {
|
||||
# Basic templater with purecss, mobile responsive layout and supports posts
|
||||
basic = import ./templaters/basic.nix;
|
||||
};
|
||||
};
|
||||
|
@ -3,7 +3,11 @@ let
|
||||
inherit (utils) readFile mapAttrsToList tags fetchGit map;
|
||||
inherit (pkgs.lib) flatten optional length;
|
||||
|
||||
stylesheets = map tags.mkStylesheet [ "https://unpkg.com/purecss@2.0.6/build/pure-min.css" "https://unpkg.com/purecss@2.0.6/build/grids-responsive-min.css" "mine.css" ];
|
||||
stylesheets = map tags.mkStylesheet [
|
||||
"https://unpkg.com/purecss@2.0.6/build/pure-min.css"
|
||||
"https://unpkg.com/purecss@2.0.6/build/grids-responsive-min.css"
|
||||
"mine.css"
|
||||
];
|
||||
|
||||
renderPost = name: value: with tags; article [
|
||||
(a { href = "#${name}"; class = "postheader"; } (h3 { id = name; } ("## " + name)))
|
||||
@ -37,6 +41,12 @@ let
|
||||
|
||||
stylesheet =
|
||||
with utils.css;
|
||||
let
|
||||
marginMobile = {
|
||||
margin-left = "3%";
|
||||
margin-right = "3%";
|
||||
};
|
||||
in
|
||||
css [
|
||||
(css {
|
||||
body = {
|
||||
@ -71,14 +81,10 @@ let
|
||||
"nav.sidebar" = {
|
||||
position = "relative";
|
||||
margin-top = "5%";
|
||||
margin-left = "3%";
|
||||
margin-right = "3%";
|
||||
};
|
||||
} // marginMobile;
|
||||
"div.content" = {
|
||||
margin-top = 0;
|
||||
margin-left = "3%";
|
||||
margin-right = "3%";
|
||||
};
|
||||
} // marginMobile;
|
||||
})
|
||||
];
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user