diff --git a/plume-models/src/blogs.rs b/plume-models/src/blogs.rs index 59991be6..7b1df681 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 95016bbb..02ed8bcf 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 26b836b7..aa4be52f 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 b35db055..07ced606 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 0ac3f44f..0cb3cdea 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 11ac6028..75818955 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) }}