Skip to content

Commit

Permalink
feat: add metadata base for twitter opengraph etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ridhozhr10 committed Jun 1, 2024
1 parent 8c743c6 commit 03cd768
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
2 changes: 0 additions & 2 deletions _contents/about.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: "About :: Ridho Azhar"
description: "Meet Ridho Azhar, a versatile software engineer passionate about creating seamless user experiences. From childhood puzzle boards to diving into web development and infrastructure technologies, Ridho thrives on solving puzzles and pushing the boundaries of software engineering. Join him on his journey of lifelong learning and problem-solving. Let's connect and solve some puzzles together!"
---

![ridho](/img/me.jpg){style="float:right;max-width:200px;margin:25px 10px;"}
Expand Down
16 changes: 2 additions & 14 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,9 @@ import BaseLayout from "@/app/_components/layout/BaseLayout";
import mdToHtml from "@/lib/markdown";
import Markdown from "@/app/_components/Markdown";
import { BiEnvelope, BiLogoGithub, BiLogoLinkedinSquare } from "react-icons/bi";
import { baseURL } from "@/constants";
import { baseMetadata } from "@/constants";

const { title, description } = getAboutContent();

export const metadata: Metadata = {
title,
description,
openGraph: {
title,
description,
url: `${baseURL}/about`,
images: ["/img/smug-ico.png"],
type: "website",
},
};
export const metadata: Metadata = baseMetadata("about", "About");

export default async function About() {
const { content } = getAboutContent();
Expand Down
1 change: 1 addition & 0 deletions src/app/posts/[...path]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export function generateMetadata({ params }: Props): Metadata {
const post = data.post;
const title = `${post.title} :: Ridho Azhar`;
return {
metadataBase: new URL(`${baseURL}/posts/${post.path.join("/")}`),
title,
description: post.description,
robots: { follow: true, index: true },
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ self proclaimed friendly person (trust me),
black coffee enjoyer`;
export const baseMetadata = (path: string, titlePrefix?: string): Metadata => {
return {
metadataBase: new URL(`${baseURL}${path ? "/" : ""}${path}`),
title: `${titlePrefix || ""}${titlePrefix ? " :: " : ""}${title}`,
description,
openGraph: {
Expand Down

0 comments on commit 03cd768

Please sign in to comment.