Skip to content

Commit

Permalink
feat: set explicit timezone in json-ld dateModified in detail blogs p…
Browse files Browse the repository at this point in the history
…age (#61)
  • Loading branch information
rezafikkri authored Dec 21, 2024
2 parents 7803837 + 00800b4 commit cc9142d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/blogs/[slug]/page.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import dayjs from "dayjs";
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
import Pagination from "@/components/post/pagination";
import PostContent from "@/components/post/post-content";
import SmallTopics from "@/components/post/small-topics";
Expand All @@ -8,6 +10,9 @@ import getBaseUrl from "@/lib/get-base-url";

const baseUrl = getBaseUrl();

dayjs.extend(utc);
dayjs.extend(timezone);

export async function generateMetadata({ params }) {
const slug = (await params).slug;
const post = getPost(slug);
Expand Down Expand Up @@ -39,7 +44,7 @@ export default async function Page({ params }) {
'@type': 'Article',
headline: post.title,
image: [ post.ogImage ],
dateModified: dayjs(post.lastmod).format(),
dateModified: dayjs(post.lastmod).tz('UTC').format('YYYY-MM-DDTHH:mm:ssZ'),
author: [
{
'@type': 'Person',
Expand Down

0 comments on commit cc9142d

Please sign in to comment.