Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd783477

Browse files
keep turbo working during 404 on cms (#1253)
1 parenta54d47c commitd783477

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

‎pgml-dashboard/src/api/cms.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,6 @@ pub struct Document {
3434
}
3535

3636
implDocument{
37-
pubfnnew(content:&str) ->Document{
38-
Document{
39-
path:PathBuf::new(),
40-
description:None,
41-
image:None,
42-
title:"404".to_string(),
43-
toc_links:Vec::new(),
44-
html: content.to_string(),
45-
}
46-
}
47-
4837
pubasyncfnfrom_path(path:&PathBuf) -> anyhow::Result<Document, std::io::Error>{
4938
let contents = tokio::fs::read_to_string(&path).await?;
5039

@@ -314,9 +303,9 @@ impl Collection {
314303
}
315304
// Return page not found on bad path
316305
_ =>{
317-
letmut layout =crate::templates::Layout::new("404",None);
306+
letmut layout =crate::templates::Layout::new("404",Some(cluster));
318307

319-
let doc =crate::api::cms::Document::new(
308+
let doc =String::from(
320309
r#"
321310
<div style='height: 80vh'>
322311
<h2>Oops, document not found!</h2>
@@ -333,7 +322,7 @@ impl Collection {
333322
.nav_title(&self.name)
334323
.footer(cluster.context.marketing_footer.to_string());
335324

336-
layout.render(crate::templates::Article{content: doc.html});
325+
layout.render(crate::templates::Article{content: doc});
337326

338327
Err(crate::responses::NotFound(layout.into()))
339328
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp