-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing CSS when 404 server Response redirects to a custom 404 pa…
…ge (#7946) * Fix missing css import on 404 redirect * Chore: changeset --------- Co-authored-by: Nate Moore <[email protected]>
- Loading branch information
1 parent
f6845d9
commit 9d00700
Showing
7 changed files
with
43 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fix: missing CSS import when 404 server Response redirects to a custom 404 page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/astro/test/fixtures/ssr-api-route-custom-404/src/content/pages/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Astro | ||
--- | ||
|
||
## Index | ||
|
||
Home page |
4 changes: 4 additions & 0 deletions
4
packages/astro/test/fixtures/ssr-api-route-custom-404/src/pages/404.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
--- | ||
import "../styles/main.css" | ||
--- | ||
|
||
<h1>Something went horribly wrong!</h1> |
9 changes: 9 additions & 0 deletions
9
packages/astro/test/fixtures/ssr-api-route-custom-404/src/pages/blog/[...ssrPath].astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
import { getEntry } from 'astro:content'; | ||
const { ssrPath } = Astro.params; | ||
const page = await getEntry('pages', ssrPath === undefined ? 'index' : ssrPath); | ||
if (!page) return new Response(null, { | ||
status: 404, | ||
statusText: 'Not found' | ||
}); | ||
--- |
3 changes: 3 additions & 0 deletions
3
packages/astro/test/fixtures/ssr-api-route-custom-404/src/styles/main.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
h1 { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters