diff --git a/assets/amatic-sc-v9-latin-regular.woff b/assets/amatic-sc-v9-latin-regular.woff new file mode 100644 index 0000000..9067b8e Binary files /dev/null and b/assets/amatic-sc-v9-latin-regular.woff differ diff --git a/assets/style.css b/assets/style.css index 115bf21..f8c538b 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1,3 +1,11 @@ +@font-face { + font-family: 'Amatic SC'; + font-style: normal; + font-weight: 400; + src: local('Amatic SC Regular'), local('AmaticSC-Regular'), + url('amatic-sc-v9-latin-regular.woff') format('woff'); +} + html { font-family: "Apple Garamond", "Baskerville", "Times New Roman", "Droid Serif", "Times", @@ -5,7 +13,7 @@ html { } h1 { - font-family: 'Amatic SC', cursive; + font-family: 'Amatic SC', sans-serif; font-weight: normal; font-style: normal; diff --git a/src/site.rs b/src/site.rs index af551f9..97499af 100644 --- a/src/site.rs +++ b/src/site.rs @@ -6,7 +6,7 @@ use std::fmt; use futures::{self, Future}; use hyper; -use hyper::header::ContentType; +use hyper::header::{ContentType, ContentLength, CacheControl, CacheDirective}; use hyper::mime; use hyper::server::*; use serde_json; @@ -82,6 +82,11 @@ struct StyleCss; #[mime = "application/javascript"] struct ScriptJs; +#[derive(StaticResource)] +#[filename = "assets/amatic-sc-v9-latin-regular.woff"] +#[mime = "application/font-woff"] +struct AmaticFont; + struct WikiLookup { state: State, lookup_map: HashMap Box>>, @@ -103,6 +108,12 @@ impl WikiLookup { as Box Box> ); + lookup_map.insert( + format!("/_assets/amatic-sc-v9-latin-regular.woff"), + Box::new(|| Box::new(AmaticFont) as Box) + as Box Box> + ); + WikiLookup { state, lookup_map } } } diff --git a/templates/layout.html b/templates/layout.html index 229f638..465e2a6 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -3,7 +3,7 @@ {{title}} - +