Skip to content

Commit bf66d7e

Browse files
committed
Fix compilation errors regarding compiler update
1 parent f75a422 commit bf66d7e

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

crates/server/src/route/post.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub async fn get(
1515
.map_err(|_| NotFound("Post not found"))?
1616
.ok_or_else(|| NotFound("Post not found"))?;
1717

18-
filepath.push(format!("{}.html", slug));
18+
filepath.push("post.html");
1919

2020
NamedFile::open(filepath)
2121
.await

crates/server/src/route/upload.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,13 @@ pub async fn post(
8787
.await
8888
.map_err(|_| BadRequest("Failed to persist archive file".to_owned()))?;
8989

90-
let meta = compiler::compile(
90+
let details = compiler::compile(
9191
&compiler::options::Options {
9292
output: std::path::Path::new(&output_dir),
9393
trim_rootdir: true,
94+
garnish_html: true,
95+
minify_html: true,
96+
minify_css: true,
9497
},
9598
&archive_path,
9699
)
@@ -101,7 +104,7 @@ pub async fn post(
101104
t.insert_post_metadata(&PostMetadata {
102105
author_id: user.id,
103106
author_username: (&user.username).into(),
104-
slug: (&meta.slug).into(),
107+
slug: (&details.meta.slug).into(),
105108
filepath: (&output_dir).into(),
106109
})
107110
.await
@@ -112,7 +115,7 @@ pub async fn post(
112115
BadRequest("Oops".into())
113116
})?;
114117

115-
let url = format!("{}/~{}/{}", env::get().host, user.username, meta.slug);
118+
let url = format!("{}/~{}/{}", env::get().host, user.username, details.meta.slug);
116119

117120
Ok(Created::new(url).body("Uploaded successfully!".to_owned()))
118121
}

0 commit comments

Comments
 (0)