Fix Wiki Titles

This commit is contained in:
spikecodes 2021-01-01 22:34:25 -08:00
parent 0925a9b334
commit 779de6f8af
2 changed files with 3 additions and 1 deletions

View File

@ -18,6 +18,7 @@ struct SubredditTemplate {
struct WikiTemplate { struct WikiTemplate {
sub: String, sub: String,
wiki: String, wiki: String,
page: String
} }
// SERVICES // SERVICES
@ -58,6 +59,7 @@ pub async fn wiki(req: HttpRequest) -> Result<HttpResponse> {
let s = WikiTemplate { let s = WikiTemplate {
sub: sub.to_string(), sub: sub.to_string(),
wiki: res["data"]["content_html"].as_str().unwrap().to_string(), wiki: res["data"]["content_html"].as_str().unwrap().to_string(),
page: page.to_string()
} }
.render() .render()
.unwrap(); .unwrap();

View File

@ -2,7 +2,7 @@
{% import "utils.html" as utils %} {% import "utils.html" as utils %}
{% block title %} {% block title %}
{% if sub != "" %}{{ sub }} {% if sub != "" %}{{ page }} - {{ sub }}
{% else %}Libreddit{% endif %} {% else %}Libreddit{% endif %}
{% endblock %} {% endblock %}