diff --git a/plume-models/src/blogs.rs b/plume-models/src/blogs.rs index 59991be..7b1df68 100644 --- a/plume-models/src/blogs.rs +++ b/plume-models/src/blogs.rs @@ -259,8 +259,7 @@ impl Blog { pub fn to_json(&self, conn: &PgConnection) -> serde_json::Value { let mut json = serde_json::to_value(self).unwrap(); - let formatted = serde_json::Value::String(format!("/~/{}",self.get_fqn(conn))); - json["fqn"] = formatted; + json["fqn"] = json!(self.get_fqn(conn)); json } } diff --git a/src/routes/posts.rs b/src/routes/posts.rs index 95016bb..02ed8bc 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -41,7 +41,7 @@ fn details_response(blog: String, slug: String, conn: DbConn, user: Option Template::render("posts/details", json!({ "author": post.get_authors(&*conn)[0].to_json(&*conn), - "post": post, + "article": post.to_json(&*conn), "blog": blog, "comments": &comments.into_iter().filter_map(|c| if c.in_response_to_id.is_none() { Some(c.to_json(&*conn, &comms)) diff --git a/templates/blogs/details.html.tera b/templates/blogs/details.html.tera index 26b836b..aa4be52 100644 --- a/templates/blogs/details.html.tera +++ b/templates/blogs/details.html.tera @@ -28,7 +28,7 @@

{{ "No posts to see here yet." | _ }}

{% endif %} {% if is_author %} - {{ "New article" | _ }} + {{ "New article" | _ }} {% endif %}
{% for article in posts %} diff --git a/templates/macros.html.tera b/templates/macros.html.tera index b35db05..07ced60 100644 --- a/templates/macros.html.tera +++ b/templates/macros.html.tera @@ -13,7 +13,7 @@ link_4="") }} ⋅ {{ article.date | date(format="%B %e") }} - ⋅ {{ article.blog.title }} + ⋅ {{ article.blog.title }}

{% endmacro post_card %} diff --git a/templates/posts/details.html.tera b/templates/posts/details.html.tera index 0ac3f44..0cb3cde 100644 --- a/templates/posts/details.html.tera +++ b/templates/posts/details.html.tera @@ -2,15 +2,15 @@ {% import "macros" as macros %} {% block title %} -{{ post.title }} +{{ article.post.title }} {% endblock title %} {% block header %} - {{ blog.title }} + {{ blog.title }} {% endblock header %} {% block content %} -

{{ post.title }}

+

{{ article.post.title }}

{{ "Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" | _( link_1='{{ date | date(format="%B %e, %Y") }}

- {{ post.content | safe }} + {{ article.post.content | safe }}
-

{{ "This article is under the {{ license }} license." | _(license=post.license) }}

+

{{ "This article is under the {{ license }} license." | _(license=article.post.license) }}

{% if account %}
- -
+

{{ n_reshares }}

{% if has_reshared %} @@ -59,7 +59,7 @@

{{ "Comments" | _ }}

{% if account %} - + {% if previous %} diff --git a/templates/users/header.html.tera b/templates/users/header.html.tera index 11ac602..7581895 100644 --- a/templates/users/header.html.tera +++ b/templates/users/header.html.tera @@ -32,5 +32,5 @@
- {{ "{{ count }} followers" | _n(singular="One follower", count=n_followers) }} + {{ "{{ count }} followers" | _n(singular="One follower", count=n_followers) }}