diff --git a/src/search.rs b/src/search.rs index d430244..3547679 100644 --- a/src/search.rs +++ b/src/search.rs @@ -54,6 +54,10 @@ pub async fn find(req: Request) -> Result, String> { return Ok(redirect("/".to_string())); } + if query.starts_with("r/") { + return Ok(redirect(format!("/{}", query))); + } + let sub = req.param("sub").unwrap_or_default(); let quarantined = can_access_quarantine(&req, &sub); // Handle random subreddits diff --git a/templates/utils.html b/templates/utils.html index fdfe350..81a4bd4 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -19,7 +19,7 @@ {% if root != "/r/" && !root.is_empty() %}
- +
{% endif %}