From eb48cc70c1614fb04faa0980c5e9b9115e65d479 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sun, 9 Oct 2022 13:37:37 +0200 Subject: [PATCH] Add logo to header and favicon. --- source/assets/mod.rs | 14 ++++++++++++++ source/assets/tildes-statistics.png | Bin 0 -> 2337 bytes source/cli/run.rs | 2 ++ source/main.rs | 1 + source/scss/index.scss | 7 +++++++ source/templates/base.html | 1 + source/templates/index.html | 1 + 7 files changed, 26 insertions(+) create mode 100644 source/assets/mod.rs create mode 100644 source/assets/tildes-statistics.png diff --git a/source/assets/mod.rs b/source/assets/mod.rs new file mode 100644 index 0000000..4ab5fc9 --- /dev/null +++ b/source/assets/mod.rs @@ -0,0 +1,14 @@ +//! Miscellaneous assets. + +use { + async_std::{fs::write, path::PathBuf}, + color_eyre::Result, +}; + +/// Write all misellaneous asset files to where they belong. +pub async fn write_assets(parent: &PathBuf) -> Result<()> { + let logo = include_bytes!("tildes-statistics.png"); + write(parent.join("tildes-statistics.png"), logo).await?; + + Ok(()) +} diff --git a/source/assets/tildes-statistics.png b/source/assets/tildes-statistics.png new file mode 100644 index 0000000000000000000000000000000000000000..e06ac260e935bde3ac657af9a5f008a153689504 GIT binary patch literal 2337 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&t&wwUqN(AjOvC?e4y!yv!>$f|%|NnFK zc=Pk^^$c%XMHw8XFfh1ql0^MwNRzJF|G((owwukj85!8qSQ!LV85jbYs7YPF$$Ulk zd97(h{%3~Uh1;1i-FW5Wf8LVFH2;F*n>JT&+s0$>d?(N7xbxcOrQbN-oVxM+Va2LS+{H@(z`Tw}@`TeHk#MFw{Zx}7MUHtxgzWF`=gdB5*ia9_|eA%}X zdp8#{RA^B(a1n-;&b4JY5E#q%kE8a(N5%@I1hz}>v{iMR^|aJ)EIkp|Z!dg&yid;D z>ikoaZ;iWc-@dN9`Kzi=dbeG5HPhZRat}J+zWv4g!3CqVIJLW>V#?{tboqrxjd|}( z-_44{?p+%l5$U9Uv}T@{@}pA`oDV@K6d}kFHvgz!|w0)|G&y!{8$U*)-L+< zt~cJy_Wz2DuRkAG3$~FZH^38?fx>uN?ssO1JA4m5xXpLamyWNyF5kdHaz?|W0Ti_i z?_Q_PwLSPb2{o_Ov9vLouZ~x&v|9ryYfptc6eLVP_;~u|ZSjefi)_T|^~uWh2O9r= zxpm+9c>g!en?4$v?2*lNR66F hMr04W@LW;PxIflQ$DU>9bzqx^!PC{xWt~$(69CR8S3v*( literal 0 HcmV?d00001 diff --git a/source/cli/run.rs b/source/cli/run.rs index cb72040..9793d9d 100644 --- a/source/cli/run.rs +++ b/source/cli/run.rs @@ -6,6 +6,7 @@ use { }; use crate::{ + assets::write_assets, charts::UserCountChart, cli::{ Cli, MainSubcommands, MigrateSubcommands, SnapshotSubcommands, @@ -112,6 +113,7 @@ pub async fn run() -> Result<()> { .render_to_file(&output) .await?; generate_css(&output).await?; + write_assets(&output).await?; if let Some(group) = user_count_group { let groups = diff --git a/source/main.rs b/source/main.rs index 086b0e9..f1af00f 100644 --- a/source/main.rs +++ b/source/main.rs @@ -11,6 +11,7 @@ use { tracing_subscriber::filter::{EnvFilter, LevelFilter}, }; +pub mod assets; pub mod charts; pub mod cli; pub mod group_data; diff --git a/source/scss/index.scss b/source/scss/index.scss index 8bc340f..2996e03 100644 --- a/source/scss/index.scss +++ b/source/scss/index.scss @@ -17,8 +17,15 @@ } .page-header { + align-items: center; border-bottom: 4px solid var(--background-2); + display: flex; padding: var(--large-spacing); + + img { + height: 4rem; + margin-right: var(--large-spacing); + } } .page-main { diff --git a/source/templates/base.html b/source/templates/base.html index dcd2fa1..e2b6571 100644 --- a/source/templates/base.html +++ b/source/templates/base.html @@ -6,6 +6,7 @@ {{ page_title }} + {% block head %}{% endblock %} diff --git a/source/templates/index.html b/source/templates/index.html index ef2c179..9a04060 100644 --- a/source/templates/index.html +++ b/source/templates/index.html @@ -6,6 +6,7 @@ {% block body %}