From 8eafd7ec5c1309712245a5c60dc5b86ad2afd8fd Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sun, 31 Jul 2022 09:30:23 +0300 Subject: [PATCH] woo yea --- pages/about.md => about.md | 0 flake.lock | 14 ++++------ flake.nix | 52 ++++++++++++++++++++++++++++++-------- main-content.html | 1 - 4 files changed, 46 insertions(+), 21 deletions(-) rename pages/about.md => about.md (100%) delete mode 100644 main-content.html diff --git a/pages/about.md b/about.md similarity index 100% rename from pages/about.md rename to about.md diff --git a/flake.lock b/flake.lock index a2a1ce3..21f80ce 100644 --- a/flake.lock +++ b/flake.lock @@ -25,17 +25,13 @@ ] }, "locked": { - "lastModified": 1659180517, - "narHash": "sha256-JHgu5lnXDPjYDbxxbYTZtUMtg0HMF3j8ZmryEw1Iw+A=", - "owner": "yusdacra", - "repo": "html.nix", - "rev": "54b5c7f003c31a171da27f37c7ba1fbb0f38381d", - "type": "github" + "narHash": "sha256-lQtjjkKu6EOqkT6jJRvzCBBWmOdtLACL//ETRAAxRQI=", + "type": "tarball", + "url": "https://git.gaze.systems/dusk/html.nix/archive/master.zip" }, "original": { - "owner": "yusdacra", - "repo": "html.nix", - "type": "github" + "type": "tarball", + "url": "https://git.gaze.systems/dusk/html.nix/archive/master.zip" } }, "nixpkgs": { diff --git a/flake.nix b/flake.nix index b239268..6a11087 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { htmlNix = { - url = "github:yusdacra/html.nix"; + url = "https://git.gaze.systems/dusk/html.nix/archive/master.zip"; inputs.flakeUtils.follows = "flakeUtils"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -23,21 +23,51 @@ ssgLib = htmlNix.lib.${system}.pkgsLib; htmlLib = htmlNix.lib; + aboutContent = + builtins.readFile + ( + ssgLib.parseMarkdown + "about.html" + (builtins.readFile ./about.md) + ); + site = local: ssgLib.mkSiteFrom { inherit local; src = ./.; - templater = ctx: - htmlLib.templaters.basic - ( - ctx - // { - indexContent = builtins.readFile ./main-content.html; - resources = { - "gaze-office.webp" = ./resources/GazeOfficeIcon.webp; + templater = ctx: let + out = + htmlLib.templaters.basic + ( + ctx + // { + indexContent = '' + ${aboutContent} + + ''; + } + ); + in + out + // { + site = + out.site + // { + resources."gaze-office.webp" = + ./resources/GazeOfficeIcon.webp; + "site.css" = '' + ${out.site."site.css"} + ${ + htmlLib.css.media "max-width: 48em" + { + "img.logo" = { + display = "none"; + }; + } + } + ''; }; - } - ); + }; }; in rec { apps = { diff --git a/main-content.html b/main-content.html deleted file mode 100644 index 8790ffc..0000000 --- a/main-content.html +++ /dev/null @@ -1 +0,0 @@ -