Skip to content

Commit

Permalink
fix: seo for page
Browse files Browse the repository at this point in the history
  • Loading branch information
AureliusIvan committed Jun 11, 2024
1 parent 161e174 commit 1459b33
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 3 deletions.
Binary file added client/public/favicon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion client/public/robot.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
User-Agent: *
Allow: /
Disallow: /private/
Sitemap: https://ivann.my.id/sitemap.xml
15 changes: 15 additions & 0 deletions client/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ const Navbar = dynamic(() => import('@/components/ui/navbar.component'), {})
export const metadata: Metadata = {
title: "Aurelius Ivan Wijaya",
description: "I'm Ivan, a software engineer who loves to write about web development, technology, and life.",
robots: {
follow: true,
index: true,
notranslate: true,
},
openGraph: {
description: "I am Ivan, a software engineer who loves to write about web development, technology, and life.",
type: 'website',
emails: ['[email protected]'],
countryName: 'Indonesia',
siteName: 'Aurelius Ivan Wijaya'
},
applicationName: 'Aurelius Ivan Wijaya',
keywords: ['Ivan', 'Aurelius', 'Wijaya', 'Software Engineer', 'Web Development', 'Technology', 'Life'],
icons: 'https://ivann.my.id/favicon.ico'
};

const font = Montserrat({
Expand Down
14 changes: 14 additions & 0 deletions client/src/app/log/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
import {MDXRemote} from 'next-mdx-remote/rsc'
import {handleGetChangelog} from "@/app/log/action";

export async function generateMetadata() {
return {
title: `Changelog`,
openGraph: {
description: "Changelog for the site",
type: 'website',
},
robots: {
follow: true,
index: true,
}
}
}

export default async function RemoteMdxPage() {
let data = await handleGetChangelog()
if (!data) return <div>...</div>
Expand Down
4 changes: 4 additions & 0 deletions client/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export async function generateMetadata(): Promise<Metadata> {
emails: ['[email protected]'],
countryName: 'Indonesia',
siteName: 'Aurelius Ivan Wijaya',
},
robots: {
follow: true,
index: true,
}
}
}
Expand Down
19 changes: 18 additions & 1 deletion client/src/app/post/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use server"

import type { Metadata, ResolvingMetadata } from 'next'

import styles from './page.module.scss'
import Link from "next/link";
import Image from "next/image";
Expand All @@ -9,9 +11,23 @@ import {getPostDataBySlug} from "@/app/action";
import {LinkButton} from "@/components/ui/button";
import {cn} from "@/lib/utils"

export default async function Page({params}: { params: { slug: string } }) {
export async function generateMetadata(
{params}: { params: { slug: string } },
parent: ResolvingMetadata
): Promise<Metadata> {
const res: any = await getPostDataBySlug(params.slug)
return {
title: res.title,
description: res.description,
openGraph: {
description: res.description,
type: 'website',
}
}
}

export default async function Page({params}: { params: { slug: string } }) {
const res: any = await getPostDataBySlug(params.slug)
if (!res) {
return <div>404</div>
}
Expand All @@ -37,6 +53,7 @@ export default async function Page({params}: { params: { slug: string } }) {

{/* close button */}
<Link
title={'Back to home'}
className='text-blue-500'
href={'/'}>
<Image
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/ui/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ interface SocialMediaIconProps {
const SocialMediaIcon = ({id, href, alt}: SocialMediaIconProps) => {
return (
<a
title={alt}
href={href}
target={"_blank"}
className={"bg-gray-800 rounded-full p-[0.5rem]"}
Expand Down Expand Up @@ -152,6 +153,7 @@ async function Footer() {
<h1>Or.. send me a mail!</h1>

<a
title={"email to ivan"}
href={"mailto:[email protected]?subject=Hello Ivan!&body=Hello Ivan! I want to say..."}
target={"_blank"}
>
Expand All @@ -163,7 +165,7 @@ async function Footer() {
"transition-transform duration-300 " +
"ease-in-out"}
src={Mail}
alt={"mail icon"}
alt={"email [email protected]"}
/>

</a>
Expand Down

0 comments on commit 1459b33

Please sign in to comment.