mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-22 18:16:30 +00:00
parent
24f2030881
commit
89713526e2
2 changed files with 6 additions and 2 deletions
|
@ -181,11 +181,14 @@ impl Post {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_json(&self, conn: &PgConnection) -> serde_json::Value {
|
pub fn to_json(&self, conn: &PgConnection) -> serde_json::Value {
|
||||||
|
let blog = self.get_blog(conn);
|
||||||
json!({
|
json!({
|
||||||
"post": self,
|
"post": self,
|
||||||
"author": self.get_authors(conn)[0].to_json(conn),
|
"author": self.get_authors(conn)[0].to_json(conn),
|
||||||
"url": format!("/~/{}/{}/", self.get_blog(conn).actor_id, self.slug),
|
"url": format!("/~/{}/{}/", blog.actor_id, self.slug),
|
||||||
"date": self.creation_date.timestamp()
|
"date": self.creation_date.timestamp(),
|
||||||
|
"blog": blog,
|
||||||
|
"blog_url": format!("/~/{}", blog.actor_id)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
link_4="</a>")
|
link_4="</a>")
|
||||||
}}
|
}}
|
||||||
⋅ {{ article.date | date(format="%B %e") }}
|
⋅ {{ article.date | date(format="%B %e") }}
|
||||||
|
⋅ <a href="{{article.blog_url}}">{{article.blog.title}}</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{% endmacro post_card %}
|
{% endmacro post_card %}
|
||||||
|
|
Loading…
Reference in a new issue