aboutsummaryrefslogtreecommitdiff
path: root/src/router.rs
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2022-06-09 20:10:19 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2022-06-09 20:10:19 +0200
commitb4472b41214eeeacce071df41bf0f782e1f16d6d (patch)
treeefb666792785ba98c177990cfc349cdb9d6a56c7 /src/router.rs
parente44658641b75076b702e690df166820c1d133f24 (diff)
downloadmacroblog.rs-b4472b41214eeeacce071df41bf0f782e1f16d6d.tar.gz
macroblog.rs-b4472b41214eeeacce071df41bf0f782e1f16d6d.tar.bz2
macroblog.rs-b4472b41214eeeacce071df41bf0f782e1f16d6d.zip
feat: Move from pico to custom css
Use css from my current blog, which is a lot smaller. The text itself looks good but the code still breaks the page. Metrics: - hyper: 16.37 KB / 16.47 KB transferred - 1 request
Diffstat (limited to 'src/router.rs')
-rw-r--r--src/router.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/router.rs b/src/router.rs
index 0bba091..35fdf3e 100644
--- a/src/router.rs
+++ b/src/router.rs
@@ -1,4 +1,4 @@
-use regex::{Regex};
+use regex::Regex;
const ACTION_REGEX: &str = r"/{0,1}(?P<action>\w*)/(?P<id>.+)";
@@ -14,14 +14,15 @@ impl Router {
let caps = re.captures(path);
let action = match caps {
Some(ref value) => &value["action"],
- None => "index"
+ None => "index",
};
match action {
- "posts" => Router::Post { page: caps.unwrap()["id"].to_string() },
+ "posts" => Router::Post {
+ page: caps.unwrap()["id"].to_string(),
+ },
"index" => Router::Index,
- _ => Router::NotFound
+ _ => Router::NotFound,
}
}
}
-