add publish date to news article
This commit is contained in:
@ -3,6 +3,7 @@ import { NewsFragment } from "@/gql/graphql";
|
|||||||
import { getClient } from "@/app/client";
|
import { getClient } from "@/app/client";
|
||||||
import { Blocks } from "@/components/blocks/Blocks";
|
import { Blocks } from "@/components/blocks/Blocks";
|
||||||
import Image from "@/components/general/Image";
|
import Image from "@/components/general/Image";
|
||||||
|
import { formatDate, commonDateFormat } from "@/lib/date";
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
const allNewsSlugsQuery = graphql(`
|
const allNewsSlugsQuery = graphql(`
|
||||||
@ -61,6 +62,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
|
|||||||
)}
|
)}
|
||||||
</figure>
|
</figure>
|
||||||
)}
|
)}
|
||||||
|
<p>{formatDate(news.firstPublishedAt, commonDateFormat)}</p>
|
||||||
</section>
|
</section>
|
||||||
<section className="page-content">
|
<section className="page-content">
|
||||||
<Blocks blocks={news.body} />
|
<Blocks blocks={news.body} />
|
||||||
|
Reference in New Issue
Block a user