Make static file links typesafe

This commit is contained in:
Joscha 2023-08-13 20:45:25 +02:00
parent e64ea7ac12
commit 1ead78d44f
4 changed files with 53 additions and 9 deletions

View file

@ -2,7 +2,10 @@ use std::fmt;
use crate::config::Config;
use super::paths::{PathIndex, PathQueue};
use super::{
paths::{PathIndex, PathQueue},
r#static::{BASE_CSS, LOGO_SVG},
};
pub enum Tab {
None,
@ -29,8 +32,8 @@ impl Base {
Tab::Queue => "queue",
};
Self {
link_logo_svg: Self::link_from_base(&config.web_base, "/logo.svg"), // TODO Static link
link_base_css: Self::link_from_base(&config.web_base, "/base.css"), // TODO Static link
link_logo_svg: Self::link_from_base(&config.web_base, LOGO_SVG),
link_base_css: Self::link_from_base(&config.web_base, BASE_CSS),
link_index: Self::link_from_base(&config.web_base, PathIndex {}),
link_queue: Self::link_from_base(&config.web_base, PathQueue {}),
web_base: config.web_base.clone(),