diff --git a/bun.lockb b/bun.lockb index 7cb7ea1..bb2d7d8 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 21a8349..2076fb7 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,6 @@ "next": "15.0.1", "next-sanity": "^9.8.7", "next-themes": "^0.3.0", - "react": "19.0.0-rc-69d4b800-20241021", - "react-dom": "19.0.0-rc-69d4b800-20241021", "react-error-boundary": "^4.1.2", "sanity": "^3.62.2", "sass": "^1.80.4", diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..a5d6a59 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/favicon-192.png b/public/favicon-192.png new file mode 100644 index 0000000..aa8539a Binary files /dev/null and b/public/favicon-192.png differ diff --git a/public/favicon-512.png b/public/favicon-512.png new file mode 100644 index 0000000..d281d33 Binary files /dev/null and b/public/favicon-512.png differ diff --git a/public/favicon.ico b/public/favicon.ico index 718d6fe..12cea14 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..c13db24 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest new file mode 100644 index 0000000..edcd510 --- /dev/null +++ b/public/manifest.webmanifest @@ -0,0 +1,14 @@ +{ + "icons": [ + { + "src": "/favicon-192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "/favicon-512.png", + "type": "image/png", + "sizes": "512x512" + } + ] +} \ No newline at end of file diff --git a/src/app/[slug]/page.tsx b/src/app/blog/[slug]/page.tsx similarity index 95% rename from src/app/[slug]/page.tsx rename to src/app/blog/[slug]/page.tsx index 35340ba..ea6212c 100644 --- a/src/app/[slug]/page.tsx +++ b/src/app/blog/[slug]/page.tsx @@ -1,7 +1,7 @@ import { defineQuery, PortableText } from "next-sanity"; import imageUrlBuilder from "@sanity/image-url"; import type { SanityImageSource } from "@sanity/image-url/lib/types/types"; -import { client, sanityFetch } from "../../sanity/client"; +import { client, sanityFetch } from "../../../sanity/client"; import Link from "next/link"; import Image from "next/image"; import { Post, SanityImageAsset } from "@/sanity/sanity.types"; @@ -66,8 +66,8 @@ export default async function PostPage(props: { params: PageParams }) { return (
- - ← Back to posts + + ← Blog {postImageUrl && ( (POSTS_QUERY, {}, options); + + return ( +
+ Home +

Blog

+ +
+ ); +} \ No newline at end of file diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 33bdcb9..d481ad2 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -5,7 +5,6 @@ import { draftMode } from "next/headers"; import { VisualEditing } from 'next-sanity' import { SanityLive } from '@/sanity/client' import { LiveErrorBoundary } from "./live-error-boundary"; -import { Toaster } from "@/components/ui/sonner"; const geistSans = localFont({ src: "../fonts/GeistVF.woff", @@ -27,6 +26,13 @@ export default async function RootLayout({ return ( + + + + + + vaporvee's Website + @@ -35,7 +41,6 @@ export default async function RootLayout({ {isEnabled && } - ); diff --git a/src/app/page.tsx b/src/app/page.tsx index 8a86888..f642d0b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,31 +1,26 @@ +import type { Home } from "@/sanity/sanity.types"; + +import { sanityFetch } from "@/sanity/client"; import Link from "next/link"; -import { type SanityDocument } from "next-sanity"; -import { client } from "@/sanity/client"; +const HOME_QUERY = `*[_type == "home"]`; -const POSTS_QUERY = `*[ - _type == "post" - && defined(slug.current) -]|order(publishedAt desc)[0...12]{_id, title, slug, publishedAt}`; - -const options = { next: { revalidate: 30 } }; export default async function IndexPage() { - const posts = await client.fetch(POSTS_QUERY, {}, options); + const result = await sanityFetch({ query: HOME_QUERY, stega: false }); + const home: Home | null = result.data.length > 0 ? result.data[0] : null; return (
-

Posts

-
    - {posts.map((post) => ( -
  • - -

    {post.title}

    -

    {new Date(post.publishedAt).toLocaleDateString()}

    - -
  • - ))} -
+ Blog

+ {home ? ( + <> +

{home.title}

+

{home.subtitle}

+ + ) : ( +

+ )}
); } \ No newline at end of file diff --git a/src/components/ui/sonner.tsx b/src/components/ui/sonner.tsx deleted file mode 100644 index 9c8e3a5..0000000 --- a/src/components/ui/sonner.tsx +++ /dev/null @@ -1,31 +0,0 @@ -"use client" - -import { useTheme } from "next-themes" -import { Toaster as Sonner } from "sonner" - -type ToasterProps = React.ComponentProps - -const Toaster = ({ ...props }: ToasterProps) => { - const { theme = "system" } = useTheme() - - return ( - - ) -} - -export { Toaster } diff --git a/src/lib/utils.ts b/src/lib/utils.ts deleted file mode 100644 index bd0c391..0000000 --- a/src/lib/utils.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { clsx, type ClassValue } from "clsx" -import { twMerge } from "tailwind-merge" - -export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) -} diff --git a/src/sanity/sanity.types.ts b/src/sanity/sanity.types.ts index 83091d9..59970ec 100644 --- a/src/sanity/sanity.types.ts +++ b/src/sanity/sanity.types.ts @@ -68,6 +68,96 @@ export type Geopoint = { alt?: number } +export type Project = { + _id: string + _type: 'project' + _createdAt: string + _updatedAt: string + _rev: string + title?: string + url?: string + tools?: Array<{ + _ref: string + _type: 'reference' + _weak?: boolean + _key: string + [internalGroqTypeReferenceTo]?: 'tool' + }> + description?: Array< + | { + children?: Array<{ + marks?: Array + text?: string + _type: 'span' + _key: string + }> + style?: 'normal' | 'h1' | 'h2' | 'h3' | 'h4' | 'blockquote' + listItem?: 'bullet' + markDefs?: Array<{ + href?: string + _type: 'link' + _key: string + }> + level?: number + _type: 'block' + _key: string + } + | { + asset?: { + _ref: string + _type: 'reference' + _weak?: boolean + [internalGroqTypeReferenceTo]?: 'sanity.imageAsset' + } + hotspot?: SanityImageHotspot + crop?: SanityImageCrop + _type: 'image' + _key: string + } + > + images?: Array<{ + asset?: { + _ref: string + _type: 'reference' + _weak?: boolean + [internalGroqTypeReferenceTo]?: 'sanity.imageAsset' + } + hotspot?: SanityImageHotspot + crop?: SanityImageCrop + _type: 'image' + _key: string + }> +} + +export type Tool = { + _id: string + _type: 'tool' + _createdAt: string + _updatedAt: string + _rev: string + name?: string + icon?: Icon + url?: string + color?: SimplerColor + description?: string +} + +export type Home = { + _id: string + _type: 'home' + _createdAt: string + _updatedAt: string + _rev: string + title?: string + subtitle?: string + owner?: { + _ref: string + _type: 'reference' + _weak?: boolean + [internalGroqTypeReferenceTo]?: 'author' + } +} + export type BlockContent = Array< | { children?: Array<{ @@ -144,7 +234,6 @@ export type Post = { [internalGroqTypeReferenceTo]?: 'category' }> publishedAt?: string - myCodeField?: Code body?: BlockContent } @@ -258,12 +347,38 @@ export type Code = { highlightedLines?: Array } +export type Icon = { + _type: 'icon' + name?: string +} + +export type HighlightColor = { + _type: 'highlightColor' + label?: string + value?: string +} + +export type TextColor = { + _type: 'textColor' + label?: string + value?: string +} + +export type SimplerColor = { + _type: 'simplerColor' + label?: string + value?: string +} + export type AllSanitySchemaTypes = | SanityImagePaletteSwatch | SanityImagePalette | SanityImageDimensions | SanityFileAsset | Geopoint + | Project + | Tool + | Home | BlockContent | Category | Post @@ -275,4 +390,8 @@ export type AllSanitySchemaTypes = | SanityImageMetadata | Slug | Code + | Icon + | HighlightColor + | TextColor + | SimplerColor export declare const internalGroqTypeReferenceTo: unique symbol