diff --git a/.gitignore b/.gitignore index f01ecd7..e9caf69 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ !.gitignore !*.gif +!*.png !*.woff2 !*.css diff --git a/flake.nix b/flake.nix index 764c3be..e033de6 100644 --- a/flake.nix +++ b/flake.nix @@ -50,6 +50,7 @@ gifFilter = path: type: builtins.match ".*gif$" path != null; jsFilter = path: type: builtins.match ".*js$" path != null; mdFilter = path: type: builtins.match ".*md$" path != null; + pngFilter = path: type: builtins.match ".*png$" path != null; txtFilter = path: type: builtins.match ".*txt$" path != null; woff2Filter = path: type: builtins.match ".*woff2$" path != null; @@ -60,7 +61,8 @@ || (gifFilter path type) || (jsFilter path type) || (mdFilter path type) - || (txtFilter path type) + || (pngFilter path type) + || (txtFilter path type) || (woff2Filter path type); }; diff --git a/src/page/icon.png b/src/page/icon.png new file mode 100644 index 0000000..673a0aa Binary files /dev/null and b/src/page/icon.png differ diff --git a/src/page/mod.rs b/src/page/mod.rs index 743d65b..588bc44 100644 --- a/src/page/mod.rs +++ b/src/page/mod.rs @@ -76,7 +76,6 @@ pub fn create(title: Option<&str>, head: Markup, body: Markup) -> Markup { name.clone() } }) } - (pname("author", name)) (property("og:site_name", name)) (property("og:title", name)) @@ -87,10 +86,8 @@ pub fn create(title: Option<&str>, head: Markup, body: Markup) -> Markup { link rel="icon" href=(asset::File("icon.gif")) type="image/gif"; - (property("og:image", &asset::File("thumbnail.png").to_string())) - (property("og:image:type", "image/png")) - (property("og:image:height", "1080")) - (property("og:image:width", "600")) + (pname("twitter:image", &asset::File("icon.png").to_string())) + (pname("theme-color", "#00FFFF")) @let url = MANIFEST.package.as_ref().unwrap().homepage().unwrap(); (property("og:url", url)) diff --git a/src/routes/assets.rs b/src/routes/assets.rs index 5310be5..0a2a646 100644 --- a/src/routes/assets.rs +++ b/src/routes/assets.rs @@ -25,7 +25,7 @@ use crate::{ }, }; -const ASSET_EXTENSIONS: &[&str] = &[".js", ".css", ".woff2", ".gif", ".txt"]; +const ASSET_EXTENSIONS: &[&str] = &[".js", ".css", ".woff2", ".gif", ".png", ".txt"]; const ROOT_EXTENSIONS: &[&str] = &[".txt"]; static ASSETS: LazyLock> = LazyLock::new(|| {