From 2031f4c52794496f042b8a20b2dfa76a32ae4737 Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Mon, 12 Dec 2022 17:13:20 +0000 Subject: [PATCH] Add license to XESS, aarch64 support --- flake.nix | 4 +++- src/css.rs | 7 +++++-- src/main.rs | 8 -------- static/css/theme.css | 15 --------------- 4 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 static/css/theme.css diff --git a/flake.nix b/flake.nix index 25b717f..f6e01ce 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ }; outputs = { self, nixpkgs, crane, flake-utils, Xess, ... }: - flake-utils.lib.eachDefaultSystem (system: + flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: let pkgs = import nixpkgs { inherit system; @@ -69,6 +69,8 @@ }; }; + defaultPackage = self.packages.${system}.bin; + devShells.default = pkgs.mkShell { inputsFrom = builtins.attrValues self.checks; diff --git a/src/css.rs b/src/css.rs index c9a80fe..a5e1d24 100644 --- a/src/css.rs +++ b/src/css.rs @@ -1,6 +1,7 @@ use std::{error::Error, path::Path, fs}; const XESS: &str = r#" +/* XESS by Xe https://github.com/Xe/Xess/blob/master/LICENSE */ :root { --background-color: 236; --text-color: 55; @@ -104,10 +105,12 @@ footer { } "#; +/// Returns either the plain XESS template with aoi theme or +/// concats it with the contents of the theme.css file. pub fn render_css() -> Result> { if Path::new("theme.css").exists() { let theme: String = fs::read_to_string("theme.css")?.parse()?; - return Ok(format!("{}\n{}", XESS, theme)) + return Ok(format!("{}{}", XESS, theme).replace("\n", "")) } - Ok(XESS.to_string()) + Ok(XESS.to_string().replace("\n", "")) } diff --git a/src/main.rs b/src/main.rs index d0d7520..912ac0d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -80,14 +80,6 @@ async fn root() -> Markup { } } -async fn page(body: &Markup) -> Markup { - html! { - (header("/")) - (body) - (footer()) - } -} - async fn get_images() -> Result, boxed::Box> { let host = "icr.gmem.ca"; let dclient = Client::configure() diff --git a/static/css/theme.css b/static/css/theme.css deleted file mode 100644 index 8e07972..0000000 --- a/static/css/theme.css +++ /dev/null @@ -1,15 +0,0 @@ -:root { - --background-color: 236; - --text-color: 55; - --accent-color: 200; - - --width: 80ch; - --padding: 0; -} - -details { - font-size: large; - border: 1px solid white; - padding: 20px; - margin-bottom: -1px; -}