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

keep turbo working during 404 on cms#1253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chillenberger merged 1 commit intomasterfromdan-doc-3
Dec 21, 2023
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletionspgml-dashboard/src/api/cms.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,17 +34,6 @@ pub struct Document {
}

impl Document {
pub fn new(content: &str) -> Document {
Document {
path: PathBuf::new(),
description: None,
image: None,
title: "404".to_string(),
toc_links: Vec::new(),
html: content.to_string(),
}
}

pub async fn from_path(path: &PathBuf) -> anyhow::Result<Document, std::io::Error> {
let contents = tokio::fs::read_to_string(&path).await?;

Expand DownExpand Up@@ -314,9 +303,9 @@ impl Collection {
}
// Return page not found on bad path
_ => {
let mut layout = crate::templates::Layout::new("404",None);
let mut layout = crate::templates::Layout::new("404",Some(cluster));

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

layout.render(crate::templates::Article { content: doc.html });
layout.render(crate::templates::Article { content: doc });

Err(crate::responses::NotFound(layout.into()))
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp