Skip to content

Commit

Permalink
refactor: Update baseUrl imports and layout metadata
Browse files Browse the repository at this point in the history
- Replaced imports of baseUrl from '@/lib/metadata' to '@/app/sitemap' across multiple files for consistency.
- Adjusted the layout metadata to ensure the default title and template are correctly formatted.
- Enhanced the structure of the metadataBase by converting baseUrl to a URL object.
  • Loading branch information
kWAYTV committed Dec 4, 2024
1 parent 8859f15 commit 68ccd85
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/(routes)/rss/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { baseUrl } from '@/app/sitemap';
import { getBlogPosts } from '@/lib/blog';
import { baseUrl } from '@/lib/metadata';

export async function GET() {
const allBlogs = await getBlogPosts();
Expand Down
2 changes: 1 addition & 1 deletion src/app/(site)/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { notFound } from 'next/navigation';

import { baseUrl } from '@/app/sitemap';
import { CustomMDX } from '@/components/core/blog/mdx';
import { formatDate, getBlogPosts } from '@/lib/blog';
import { baseUrl } from '@/lib/metadata';

export async function generateStaticParams() {
const posts = getBlogPosts();
Expand Down
8 changes: 4 additions & 4 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import './globals.css';
import localFont from 'next/font/local';
import { ViewTransitions } from 'next-view-transitions';

import { baseUrl } from '@/app/sitemap';
import Footer from '@/components/layout/footer';
import { Navbar } from '@/components/layout/nav';
import { Providers } from '@/components/providers';
import { createMetadata } from '@/lib/metadata';
import { baseUrl } from '@/lib/metadata';

const geistSans = localFont({
src: './fonts/GeistVF.woff',
Expand Down Expand Up @@ -46,9 +46,9 @@ export default function RootLayout({

export const metadata = createMetadata({
title: {
template: '%s | perc.dev',
default: 'perc.dev'
default: 'perc.dev',
template: '%s | perc.dev'
},
description: 'Welcome to my portfolio!',
metadataBase: baseUrl
metadataBase: new URL(baseUrl)
});
2 changes: 1 addition & 1 deletion src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { baseUrl } from '@/lib/metadata';
import { baseUrl } from '@/app/sitemap';

export default function robots() {
return {
Expand Down

0 comments on commit 68ccd85

Please sign in to comment.