add separate template for the "latest post" page (the home/main page)
since it's reasonable to assume some may want to customize this a little differently than the normal post page.
This commit is contained in:
parent
b8200b220d
commit
2d9ce75ec0
4
example-site/templates/latest_post.html
Normal file
4
example-site/templates/latest_post.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% block content %}
|
||||||
|
{% include "partials/post.html" %}
|
||||||
|
{% endblock content %}
|
|
@ -343,7 +343,7 @@ impl SiteService {
|
||||||
if let Some(post) = post {
|
if let Some(post) = post {
|
||||||
context.insert("post", post);
|
context.insert("post", post);
|
||||||
}
|
}
|
||||||
HttpResponse::Ok().body(self.template_renderer.render("post.html", &context).unwrap())
|
HttpResponse::Ok().body(self.template_renderer.render("latest_post.html", &context).unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn serve_posts_by_tag(&self, tag: &Tag) -> HttpResponse {
|
pub fn serve_posts_by_tag(&self, tag: &Tag) -> HttpResponse {
|
||||||
|
|
Loading…
Reference in a new issue