This commit is contained in:
parent
2e2dc13d43
commit
39fde5225d
2 changed files with 3 additions and 3 deletions
|
@ -118,12 +118,12 @@ struct BlogPostTemplate {
|
|||
post: Option<File>,
|
||||
}
|
||||
|
||||
#[get("/blog/{id}")]
|
||||
#[get("/blog/p/{id}")]
|
||||
pub async fn page(path: web::Path<(String,)>, config: web::Data<Config>) -> impl Responder {
|
||||
HttpResponse::Ok().body(build_post(path.into_inner().0, config.get_ref().to_owned()))
|
||||
}
|
||||
|
||||
pub fn build_post(file: String, config: Config) -> String {
|
||||
fn build_post(file: String, config: Config) -> String {
|
||||
let mut post = None;
|
||||
let infos = get_post(&mut post, file);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<div class="timeline">
|
||||
<ul>
|
||||
{{#posts}}
|
||||
<li onclick="location.href='/blog/{{url}}';">
|
||||
<li onclick="location.href='/blog/p/{{url}}';">
|
||||
{{>blog/date.html}}
|
||||
<div class="content">
|
||||
<h2>{{title}}</h2>
|
||||
|
|
Loading…
Reference in a new issue