Skip to content

Commit

Permalink
Add SlugNotFound component and update en.json for news page
Browse files Browse the repository at this point in the history
  • Loading branch information
NebraskaCoder committed Feb 12, 2024
1 parent 6cb9806 commit 1fb66df
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/[locale]/news/[slug]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Link from "next/link";
import { useTranslations } from "next-intl";

export default function SlugNotFound() {
const t = useTranslations("news.notFound");

return (
<div className="pt-10 pb-24 sm:pt-12 sm:pb-32">
<div className="mx-auto max-w-3xl text-base leading-7">
<h1 className="mt-2 text-3xl font-bold tracking-tight sm:text-4xl mb-12 text-center font-display">
{t("title")}
</h1>
<div className="prose dark:prose-invert prose-headings:font-display prose-a:text-primary prose-pre:bg-muted prose-pre:py-3 prose-pre:px-4 prose-pre:rounded prose-img:rounded-md max-w-none">
{t.rich("description", {
newsLink: (chunks) => <Link href="/news">{chunks}</Link>,
})}
</div>
</div>
</div>
);
}
6 changes: 6 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,11 @@
"description": "Migrate from other Enterprise Linux distributions without sweating it. We provide an easy-to-use migration script, free of charge."
}
}
},
"news": {
"notFound": {
"title": "Not Found",
"description": "The news post you are looking for does not exist. You can find all our news posts on the <newsLink>news page</newsLink>."
}
}
}

0 comments on commit 1fb66df

Please sign in to comment.