Skip to content

Commit

Permalink
Update page titles and metadata for news pages
Browse files Browse the repository at this point in the history
  • Loading branch information
FoggyMtnDrifter committed Feb 19, 2024
1 parent 2eb98ee commit 9a86b6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/[locale]/news/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function generateMetadata({ params }: Props) {
const postData: PostData = await getPostData(slug);

return {
title: postData.title,
title: `${postData.title} - Rocky Linux`,
};
}

Expand Down
14 changes: 13 additions & 1 deletion app/[locale]/news/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
import type { NextPage } from "next";

import { getTranslations } from "next-intl/server";
import Link from "next/link";
import { format } from "date-fns";

import { getSortedPostsData } from "@/lib/news";

import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { getTranslations } from "next-intl/server";

export async function generateMetadata() {
const t = await getTranslations("news");

return {
title: `${t("title")} - Rocky Linux`,
description: `${t("description")}`,
};
}

const NewsPage: NextPage = async () => {
const posts = await getSortedPostsData();
Expand Down

0 comments on commit 9a86b6e

Please sign in to comment.