From f4318dcda8e06e2200f545213b57da4617c4ce2b Mon Sep 17 00:00:00 2001 From: Jack Merrill Date: Wed, 14 Jun 2023 22:44:22 -0500 Subject: [PATCH] finalize site :tada: --- .vercelignore | 1 + package.json | 1 + src/app/@project/(.)projects/[id]/page.tsx | 2 +- src/app/about/page.tsx | 20 +-- src/app/blog/[id]/page.tsx | 12 +- src/app/internal/studio/[[...index]]/page.tsx | 6 +- src/app/layout.tsx | 25 ++-- src/app/page.tsx | 26 ++-- src/app/projects/[id]/page.tsx | 43 ++++-- src/app/projects/page.tsx | 56 ++++---- src/components/Codeblock.tsx | 5 +- src/components/Navbar.tsx | 126 ++++++++++++++---- src/components/SidecardList.tsx | 11 +- tailwind.config.js | 6 + yarn.lock | 79 ++++++++++- 15 files changed, 307 insertions(+), 112 deletions(-) create mode 100644 .vercelignore diff --git a/.vercelignore b/.vercelignore new file mode 100644 index 0000000..4ee0a91 --- /dev/null +++ b/.vercelignore @@ -0,0 +1 @@ +/src/app/internal \ No newline at end of file diff --git a/package.json b/package.json index 732b657..3084490 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@heroicons/react": "^2.0.18", + "@next/bundle-analyzer": "^13.4.5", "@radix-ui/react-context-menu": "^2.1.3", "@radix-ui/react-dialog": "^1.0.4", "@radix-ui/react-dropdown-menu": "^2.0.4", diff --git a/src/app/@project/(.)projects/[id]/page.tsx b/src/app/@project/(.)projects/[id]/page.tsx index 3be94fe..87876f4 100644 --- a/src/app/@project/(.)projects/[id]/page.tsx +++ b/src/app/@project/(.)projects/[id]/page.tsx @@ -62,7 +62,7 @@ export default function ProjectModal({ - + +
-

Hey! I'm Jack Merrill.

+

+ Hey! I'm Jack Merrill. +

-

+

I'm a software engineer, designer, and student from the United States. I'm working to bring accessible designs to the masses.

-
-
-
+
+
+
@@ -27,9 +29,9 @@ export default async function Page() {
-

About Me

+

About Me

-

+

I'm a Division II (sophomore) student at Hampshire College, studying interaction design. I'm also a full-stack web developer at{" "} @@ -43,8 +45,6 @@ export default async function Page() { .

- -

); diff --git a/src/app/blog/[id]/page.tsx b/src/app/blog/[id]/page.tsx index 39f6bef..168ca38 100644 --- a/src/app/blog/[id]/page.tsx +++ b/src/app/blog/[id]/page.tsx @@ -55,7 +55,7 @@ export default async function Page({
{/* the content */} -
+
); } + +export async function generateStaticParams() { + const { query, schema } = q("*") + .filterByType("post") + .grabOne$("slug.current", q.string()); + + const slugs = schema.parse(await client.fetch(query)); + + return slugs.map((slug) => ({ params: { id: slug } })); +} diff --git a/src/app/internal/studio/[[...index]]/page.tsx b/src/app/internal/studio/[[...index]]/page.tsx index 027c14e..f0602d9 100644 --- a/src/app/internal/studio/[[...index]]/page.tsx +++ b/src/app/internal/studio/[[...index]]/page.tsx @@ -12,7 +12,11 @@ import { NextStudio } from "next-sanity/studio"; import config from "../../../../../sanity.config"; -const isDev = process.env.NODE_ENV === "development" || !process.env.NODE_ENV; +const isDev = + process.env.NODE_ENV === "development" || + !process.env.NODE_ENV || + process.env.NEXT_PUBLIC_ENV === "development" || + !process.env.NEXT_PUBLIC_ENV; export default function StudioPage() { return isDev ? : null; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index c3cc330..8f35269 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -32,15 +32,15 @@ export default async function RootLayout({ }) { const { query: projectQuery, schema: projectSchema } = q("*") .filterByType("project") - .slice(0, 3) .order("publishedAt desc") .grab$({ title: q.string(), subtitle: q.string(), slug: q.slug("slug"), publishedAt: q.date(), - mainImage: q("mainImage").grabOne$("asset->url", q.string()), - }); + mainImage: q("mainImage").grabOne$("asset->url", q.string().optional()), + }) + .slice(0, 2); const { query: blogQuery, schema: blogSchema } = q("*") .filterByType("post") @@ -53,7 +53,8 @@ export default async function RootLayout({ categories: q("categories") .filter() .deref() - .grabOne$("title", q.string()), + .grabOne$("title", q.string()) + .nullable(), }); const latestThreeProjects = projectSchema.parse( @@ -74,13 +75,13 @@ export default async function RootLayout({
{children}
-
-
-

+

+
+

Made with by Jack Merrill @@ -93,20 +94,20 @@ export default async function RootLayout({ : "dev"}

-
+
- + - + - +
diff --git a/src/app/page.tsx b/src/app/page.tsx index 12f8101..2d9c04f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -15,7 +15,7 @@ import Image from "next/image"; export default function Home() { return ( <> -
+

-
+

What I do

-
-
+
+
- +

UI Design

Designing interfaces and websites that are accessible, usable, @@ -55,10 +55,10 @@ export default function Home() {

-
+
- {" "} + {" "}

Development

Building websites and software that are fast, responsive, and @@ -67,10 +67,10 @@ export default function Home() {

-
+
- {" "} + {" "}

Creative

Creating stunning designs and illustrations that are unique @@ -79,10 +79,10 @@ export default function Home() {

-
+
- {" "} + {" "}

Other

I'm always looking to learn new things and expand my @@ -95,8 +95,8 @@ export default function Home() {

-
-

+
+

Tell me about your next project

diff --git a/src/app/projects/[id]/page.tsx b/src/app/projects/[id]/page.tsx index 1bc6ea1..034f292 100644 --- a/src/app/projects/[id]/page.tsx +++ b/src/app/projects/[id]/page.tsx @@ -7,26 +7,25 @@ import remarkGfm from "remark-gfm"; import rehypeRaw from "rehype-raw"; export default async function Page({ - params: { id: slug }, + params: { id }, }: { params: { id: string }; }) { const { query: projectQuery, schema: projectSchema } = q("*") .filterByType("project") - .filter(`slug.current == "${slug}"`) + .filter(`slug.current == "${id}"`) .grab$({ title: q.string(), subtitle: q.string(), slug: q.slug("slug"), publishedAt: q.date(), content: q.string(), - mainImage: q("mainImage").grabOne$("asset->url", q.string()), - }) - .slice(0, 1); + mainImage: q("mainImage").grabOne$("asset->url", q.string().optional()), + }); const project = projectSchema.parse(await client.fetch(projectQuery))[0]; - const r = project.mainImage.match(/(?\d+)x(?\d+)/); + const r = project.mainImage?.match(/(?\d+)x(?\d+)/); return (
@@ -44,18 +43,20 @@ export default async function Page({

- {project.title} + {project.mainImage && ( + {project.title} + )}
{/* the content */} -
+
); } + +export async function generateStaticParams() { + const { query: projectQuery, schema: projectSchema } = q("*") + .filterByType("project") + .grabOne$("slug.current", q.string()); + + const projects = projectSchema.parse(await client.fetch(projectQuery)); + + return projects.map((project) => ({ + params: { + slug: project, + }, + })); +} diff --git a/src/app/projects/page.tsx b/src/app/projects/page.tsx index f1859e7..e2e3791 100644 --- a/src/app/projects/page.tsx +++ b/src/app/projects/page.tsx @@ -13,7 +13,7 @@ export default async function Page() { subtitle: q.string(), slug: q.slug("slug"), publishedAt: q.date(), - mainImage: q("mainImage").grabOne$("asset->url", q.string()), + mainImage: q("mainImage").grabOne$("asset->url", q.string().optional()), categories: q("categories") .filter() .deref() @@ -24,7 +24,7 @@ export default async function Page() { return (
-
+

Projects @@ -35,39 +35,45 @@ export default async function Page() {

-
-
+
+
{projects.map((project) => { - const r = project.mainImage.match(/(?\d+)x(?\d+)/); + const r = project.mainImage?.match(/(?\d+)x(?\d+)/); return ( - {project.title} -

{project.title}

-

{project.subtitle}

+
+ {project.mainImage && ( + {project.title} + )} +

{project.title}

+

{project.subtitle}

+
-

- Categories: - {project.categories.map((category) => ( - - {category} - - ))} +

+

+ Categories: + {project.categories.map((category) => ( + + {category} + + ))} +

-
+