Add logo to header and favicon.

This commit is contained in:
Bauke 2022-10-09 13:37:37 +02:00
parent 0cf9dda4fd
commit eb48cc70c1
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
7 changed files with 26 additions and 0 deletions

14
source/assets/mod.rs Normal file
View File

@ -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(())
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -6,6 +6,7 @@ use {
}; };
use crate::{ use crate::{
assets::write_assets,
charts::UserCountChart, charts::UserCountChart,
cli::{ cli::{
Cli, MainSubcommands, MigrateSubcommands, SnapshotSubcommands, Cli, MainSubcommands, MigrateSubcommands, SnapshotSubcommands,
@ -112,6 +113,7 @@ pub async fn run() -> Result<()> {
.render_to_file(&output) .render_to_file(&output)
.await?; .await?;
generate_css(&output).await?; generate_css(&output).await?;
write_assets(&output).await?;
if let Some(group) = user_count_group { if let Some(group) = user_count_group {
let groups = let groups =

View File

@ -11,6 +11,7 @@ use {
tracing_subscriber::filter::{EnvFilter, LevelFilter}, tracing_subscriber::filter::{EnvFilter, LevelFilter},
}; };
pub mod assets;
pub mod charts; pub mod charts;
pub mod cli; pub mod cli;
pub mod group_data; pub mod group_data;

View File

@ -17,8 +17,15 @@
} }
.page-header { .page-header {
align-items: center;
border-bottom: 4px solid var(--background-2); border-bottom: 4px solid var(--background-2);
display: flex;
padding: var(--large-spacing); padding: var(--large-spacing);
img {
height: 4rem;
margin-right: var(--large-spacing);
}
} }
.page-main { .page-main {

View File

@ -6,6 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ page_title }}</title> <title>{{ page_title }}</title>
<link rel="shortcut icon" href="/tildes-statistics.png" type="image/png">
<link rel="stylesheet" href="/css/modern-normalize.css"> <link rel="stylesheet" href="/css/modern-normalize.css">
<link rel="stylesheet" href="/css/common.css"> <link rel="stylesheet" href="/css/common.css">
{% block head %}{% endblock %} {% block head %}{% endblock %}

View File

@ -6,6 +6,7 @@
{% block body %} {% block body %}
<header class="page-header"> <header class="page-header">
<img src="/tildes-statistics.png" alt="Tildes Statistics Logo">
<h1>Tildes Statistics</h1> <h1>Tildes Statistics</h1>
</header> </header>