From 779de6f8af4ba6d5cc2b82b941576482ae989c57 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Fri, 1 Jan 2021 22:34:25 -0800 Subject: [PATCH] Fix Wiki Titles --- src/subreddit.rs | 2 ++ templates/wiki.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/subreddit.rs b/src/subreddit.rs index 9f0bdca..7c33fd4 100644 --- a/src/subreddit.rs +++ b/src/subreddit.rs @@ -18,6 +18,7 @@ struct SubredditTemplate { struct WikiTemplate { sub: String, wiki: String, + page: String } // SERVICES @@ -58,6 +59,7 @@ pub async fn wiki(req: HttpRequest) -> Result { let s = WikiTemplate { sub: sub.to_string(), wiki: res["data"]["content_html"].as_str().unwrap().to_string(), + page: page.to_string() } .render() .unwrap(); diff --git a/templates/wiki.html b/templates/wiki.html index fa0cad8..c2244c2 100644 --- a/templates/wiki.html +++ b/templates/wiki.html @@ -2,7 +2,7 @@ {% import "utils.html" as utils %} {% block title %} - {% if sub != "" %}{{ sub }} + {% if sub != "" %}{{ page }} - {{ sub }} {% else %}Libreddit{% endif %} {% endblock %}