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 0000000..e06ac26 Binary files /dev/null and b/source/assets/tildes-statistics.png differ 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 @@