feat(blog): add redirect to 404 page if entry is not found

This commit adds a redirect to the 404 page if the entry is not found. This ensures that users are directed to the appropriate page when accessing a non-existent blog entry.
This commit is contained in:
Jewgeni 2024-10-05 10:02:39 +02:00
parent 0028c52496
commit 6cd32df0ee

View File

@ -21,6 +21,11 @@ interface Props {
}
const { entry } = Astro.props as Props;
if (!entry) {
return Astro.redirect('/404');
}
const { Content } = await entry.render();
const components = { table: Table };
const {