pub mod urls {
    use seed::Url;
    pub fn search(query: &str, page: usize) -> Url {
        let query = Url::encode_uri_component(query);
        if page > 0 {
            Url::new().set_hash_path(["s", &query, &format!("p{page}")])
        } else {
            Url::new().set_hash_path(["s", &query])
        }
    }
    pub fn thread(tid: &str) -> Url {
        Url::new().set_hash_path(["t", tid])
    }
}
