forked from Laughing0900/vite-portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use Next/ font, image, sitemap
- Loading branch information
1 parent
df51f78
commit 9b02b0f
Showing
29 changed files
with
110 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: 'export', // Outputs a Single-Page Application (SPA). | ||
// output: 'export', // Outputs a Single-Page Application (SPA). | ||
distDir: './dist', // Changes the build output directory to `./dist/`. | ||
|
||
images: { | ||
remotePatterns: [ | ||
{ | ||
protocol: 'https', | ||
hostname: 'res.cloudinary.com', | ||
port: '', | ||
}, | ||
], | ||
}, | ||
} | ||
|
||
export default nextConfig |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { MetadataRoute } from "next"; | ||
import { API_ENDPOINT, BASE_URL } from "@/consts/apis"; | ||
|
||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> { | ||
const data = await fetch(API_ENDPOINT + "projects").then((res) => | ||
res.json() | ||
); | ||
const projects = data.body; | ||
|
||
const projectSitemap = projects.map((project: any) => ({ | ||
url: `${BASE_URL}/project/${project.id}`, | ||
changeFrequency: "yearly", | ||
priority: 0.8, | ||
})); | ||
|
||
return [ | ||
{ | ||
url: "laughing-portfolio.vercel.app", | ||
lastModified: new Date(), | ||
changeFrequency: "yearly", | ||
priority: 1, | ||
}, | ||
...projectSitemap, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"use client"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
|
||
export const BentoGrid = ({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
type ImageProps = React.HTMLProps<HTMLImageElement>; | ||
import Image from "next/image"; | ||
|
||
const Image: React.FC<ImageProps & { loading?: "lazy" | "eager" }> = ({ | ||
...props | ||
}) => { | ||
return <img {...props}></img>; | ||
}; | ||
export default Image; | ||
|
||
export function cloudinaryLoader({ | ||
src, | ||
width, | ||
quality, | ||
}: { | ||
src: string; | ||
width: number; | ||
quality?: number; | ||
}) { | ||
const params = [ | ||
"f_auto", | ||
"c_limit", | ||
`w_${width}`, | ||
`q_${quality || "auto"}`, | ||
]; | ||
return `https://res.cloudinary.com/dicmdiiov/image/upload/${params.join(",")}/v1/Pawn/portfolio${src}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.