From e731cfbac4d0ef294cdf1ccb19081a07eb47ec5f Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Tue, 9 Feb 2021 10:11:39 -0800 Subject: [PATCH] Support post links without titles --- src/main.rs | 2 ++ templates/base.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 8e4bb1d..b3dcd6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -160,6 +160,7 @@ async fn main() -> tide::Result<()> { app.at("/u/:name/comments/:id/:title/:comment/").get(post::item); app.at("/user/:name/").get(user::profile); + app.at("/user/:name/comments/:id/").get(post::item); app.at("/user/:name/comments/:id/:title/").get(post::item); app.at("/user/:name/comments/:id/:title/:comment/").get(post::item); @@ -173,6 +174,7 @@ async fn main() -> tide::Result<()> { app.at("/r/:sub/subscribe/").post(subreddit::subscriptions); app.at("/r/:sub/unsubscribe/").post(subreddit::subscriptions); // View post on subreddit + app.at("/r/:sub/comments/:id/").get(post::item); app.at("/r/:sub/comments/:id/:title/").get(post::item); app.at("/r/:sub/comments/:id/:title/:comment_id/").get(post::item); // Search inside subreddit diff --git a/templates/base.html b/templates/base.html index d523df6..db7d34f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -35,7 +35,7 @@ {% block search %}{% endblock %}