Skip to content

Commit

Permalink
fix: seo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartek532 committed Jul 26, 2024
1 parent db7dfee commit e793ad5
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 17 deletions.
1 change: 1 addition & 0 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const metadata = getMetadata({
title: "About",
description,
image: "/img/about.png",
url: "/about",
});

const AboutPage = () => (
Expand Down
1 change: 1 addition & 0 deletions app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export async function generateMetadata({ params: { slug } }: MetadataParams) {
type: "article",
author: frontmatter.author,
image: frontmatter.image,
url: `/blog/${slug}`,
});
}

Expand Down
1 change: 1 addition & 0 deletions app/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const metadata = getMetadata({
title: "Blog",
description,
image: "/img/blog.png",
canonical: "/blog",
});

const BlogPage = async () => {
Expand Down
5 changes: 0 additions & 5 deletions app/confetti/page.tsx

This file was deleted.

7 changes: 6 additions & 1 deletion app/contact/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { getMetadata } from "lib/metadata";

const description = "Do you want to cooperate? Ask for something? Or just chat? Let me know 💬";

export const metadata = getMetadata({ title: "Contact", description, image: "/img/contact.png" });
export const metadata = getMetadata({
title: "Contact",
description,
image: "/img/contact.png",
url: "/contact",
});

const ContactPage = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const kenfolg = localFont({
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html
lang="en-EN"
lang="en"
dir="ltr"
prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"
itemType="http://schema.org/WebPage"
Expand Down
1 change: 1 addition & 0 deletions app/work/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export async function generateMetadata({ params: { slug } }: MetadataParams) {
type: "article",
author: frontmatter.author,
image: frontmatter.image,
url: `/work/${slug}`,
});
}

Expand Down
1 change: 1 addition & 0 deletions app/work/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const metadata = getMetadata({
title: "Work",
description,
image: "/img/work.png",
url: "/work",
});

const WorkPage = () => (
Expand Down
4 changes: 2 additions & 2 deletions components/tile/about/AboutTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const AboutTile = () => (
<Image src={WinkingAvatar} alt="winking memoji" />
</div>
<p className={styles.description}>
I&#39;m <strong className={styles.name}>Bart</strong>, software engineer building products to
help people lead better lives 🎯 In love with creative solutions - constantly learning and
I&#39;m <h1 className={styles.name}>Bart</h1>, software engineer building products to help
people lead better lives 🎯 In love with creative solutions - constantly learning and
discovering new stuff 📖
</p>
<div className={styles.more}>
Expand Down
1 change: 1 addition & 0 deletions components/tile/about/aboutTile.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
.name {
font-family: var(--font-kenfolg), "Georgia", "Garamond", serif;
font-size: 2rem;
display: inline-block;
}
}

Expand Down
6 changes: 3 additions & 3 deletions data/authors.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const allAuthors = [
{
name: "Bartosz Zagrodzki",
avatar: "/img/authors/zagrodzki.jpg",
avatar: "/img/authors/zagrodzki.webp",
meta: {
youtube: "",
github: "https://github.com/Bartek532",
Expand All @@ -10,8 +10,8 @@ export const allAuthors = [
linkedin: "https://www.linkedin.com/in/zagrodzki/",
last_name: "Zagrodzki",
first_name: "Bartosz",
website: "https://zagrodzki.me",
about: "https://zagrodzki.me/about",
website: "https://www.zagrodzki.me",
about: "https://www.zagrodzki.me/about",
description:
"Blogger, software engineer and the main coordinator of this blog, he has lots of ideas and won't hesitate to use them! He lives in Poland.",
},
Expand Down
2 changes: 1 addition & 1 deletion data/experience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const allPositions = [
position: "Blogger",
company: "zagrodzki.me",
date: "02.2022 - present",
link: "https://zagrodzki.me",
link: "https://www.zagrodzki.me",
},
{
id: 3,
Expand Down
12 changes: 12 additions & 0 deletions lib/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interface SeoProps {
readonly image?: string;
readonly publishedAt?: string;
readonly type?: "article" | "website";
readonly canonical?: string;
readonly url?: string;
}

export const DEFAULT_METADATA: Metadata = {
Expand Down Expand Up @@ -114,15 +116,25 @@ export const getMetadata = (
author,
type = "website",
publishedAt,
canonical,
url,
} = {} as SeoProps,
): Metadata => ({
title,
description,
...{
...(canonical && {
alternates: {
canonical: `${HOST}${canonical}`,
},
}),
},
openGraph: {
type,
title,
locale: "en_EN",
description,
url: url ? `${HOST}${url}` : canonical ? `${HOST}${canonical}` : HOST,
images: {
width: 1200,
height: 880,
Expand Down
2 changes: 1 addition & 1 deletion next-sitemap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
siteUrl: "https://zagrodzki.me",
siteUrl: "https://www.zagrodzki.me",
generateRobotsTxt: true,
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "zagrodzki.me",
"private": true,
"description": "My personal website",
"homepage": "https://zagrodzki.me",
"homepage": "https://www.zagrodzki.me",
"bugs": {
"url": "https://github.com/Bartek532/zagrodzki.me/issues"
},
Expand All @@ -15,7 +15,7 @@
"algolia": "tsx ./scripts/algolia.ts ",
"build": "./build.sh redirect feed algolia next",
"build:next": "next build",
"dev": "next dev -p 3001",
"dev": "next dev",
"feed": "tsx ./scripts/feed.ts",
"format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,scss,md,mdx}\"",
"lint": "next lint",
Expand Down
Binary file removed public/img/authors/zagrodzki.jpg
Binary file not shown.
Binary file added public/img/authors/zagrodzki.webp
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion utils/consts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { env } from "env/client";

export const ORIGIN =
env.NEXT_PUBLIC_HOST ?? env.NEXT_PUBLIC_VERCEL_URL ?? ("zagrodzki.me" as const);
env.NEXT_PUBLIC_HOST ?? env.NEXT_PUBLIC_VERCEL_URL ?? ("www.zagrodzki.me" as const);
export const PROTOCOL = process.env.NODE_ENV === "production" ? "https" : "http";
export const HOST = `${PROTOCOL}://${ORIGIN}` as const;

Expand Down

0 comments on commit e793ad5

Please sign in to comment.