css caching

This commit is contained in:
Robin Appelman 2023-04-08 20:53:34 +02:00
commit 6485612898
5 changed files with 36 additions and 5 deletions

View file

@ -10,12 +10,17 @@ pub trait Page {
}
pub fn render<T: Page>(page: T) -> Markup {
let style_url = concat!(
"/style.",
include_str!(concat!(env!("OUT_DIR"), "/style.md5")),
".css",
);
html! {
(DOCTYPE)
html {
head {
title { (page.title()) }
link rel="stylesheet" type="text/css" href="/style.css";
link rel="stylesheet" type="text/css" href=(style_url);
}
body {
header {