diff --git a/.env b/.env new file mode 100644 index 0000000..ffe1159 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +SITE_NAME=RezaFikkri diff --git a/app/about/page.jsx b/app/about/page.jsx index 7ed3c9f..9666a9e 100644 --- a/app/about/page.jsx +++ b/app/about/page.jsx @@ -1,9 +1,11 @@ import Profile from "@/components/about/profile"; import Summary from "@/components/about/summary"; import Skill from "@/components/about/skill"; +import getBaseUrl from "@/lib/get-base-url"; const title = "Tentang Saya"; const description = "Seorang backend web developer, suka menulis dan juga membuat aplikasi open source."; +const baseUrl = getBaseUrl(); export const metadata = { title, @@ -11,10 +13,10 @@ export const metadata = { openGraph: { title, description, - url: '/about', + url: `${baseUrl}/about`, images: [ { - url: '/rezas.jpg', + url: `${baseUrl}/rezas.jpg`, width: 400, height: 400, }, diff --git a/app/blogs/[slug]/page.jsx b/app/blogs/[slug]/page.jsx index 485d649..b9a8c3c 100644 --- a/app/blogs/[slug]/page.jsx +++ b/app/blogs/[slug]/page.jsx @@ -1,12 +1,15 @@ +import dayjs from "dayjs"; import Pagination from "@/components/post/pagination"; import PostContent from "@/components/post/post-content"; import SmallTopics from "@/components/post/small-topics"; import { getPost, getSlugs, getTopics } from "@/lib/posts.mjs"; import FormatTime from "@/components/format-time"; +import getBaseUrl from "@/lib/get-base-url"; export async function generateMetadata({ params }) { const slug = (await params).slug; const post = getPost(slug); + const baseUrl = getBaseUrl(); return { title: post.title, @@ -14,8 +17,8 @@ export async function generateMetadata({ params }) { openGraph: { title: post.title, description: post.excerpt, - url: `/blogs/${post.slug}`, - images: [ post.ogImage ], + url: `${baseUrl}/blogs/${post.slug}`, + images: [ baseUrl + post.ogImage ], type: 'article', }, }; @@ -29,9 +32,29 @@ export default async function Page({ params }) { const slug = (await params).slug; const post = getPost(slug); const topics = getTopics(post.topics); + const baseUrl = getBaseUrl(); + + const jsonLd = { + '@context': 'https://schema.org', + '@type': 'Article', + headline: post.title, + image: [ baseUrl + post.ogImage ], + dateModified: dayjs(post.lastmod).toISOString(), + author: [ + { + '@type': 'Person', + name: 'Reza Sariful Fikri', + url: `${baseUrl}/about`, + } + ], + }; return ( <> +