mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2025-02-16 23:15:14 +00:00
Define Post::slug()
This commit is contained in:
parent
859a1fd528
commit
87457c0ed1
1 changed files with 5 additions and 0 deletions
|
@ -253,6 +253,11 @@ impl Post {
|
||||||
ap_url(&format!("{}/~/{}/{}/", CONFIG.base_url, blog.fqn, slug))
|
ap_url(&format!("{}/~/{}/{}/", CONFIG.base_url, blog.fqn, slug))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It's better to calc slug in insert and update
|
||||||
|
pub fn slug(title: &str) -> &str {
|
||||||
|
title
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_authors(&self, conn: &Connection) -> Result<Vec<User>> {
|
pub fn get_authors(&self, conn: &Connection) -> Result<Vec<User>> {
|
||||||
use crate::schema::post_authors;
|
use crate::schema::post_authors;
|
||||||
use crate::schema::users;
|
use crate::schema::users;
|
||||||
|
|
Loading…
Reference in a new issue