Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions app/(main)/(author)/author/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Metadata, ResolvingMetadata } from "next";
import { groq, type PortableTextBlock } from "next-sanity";
import { type PortableTextBlock } from "next-sanity";
import { notFound } from "next/navigation";

import PortableText from "@/components/portable-text";
Expand All @@ -9,7 +9,6 @@ import type {
AuthorQueryWithRelatedResult,
} from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";
import { authorQuery, authorQueryWithRelated } from "@/sanity/lib/queries";
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
import CoverMedia from "@/components/cover-media";
Expand All @@ -20,7 +19,6 @@ import UserRelated from "@/components/user-related";

type Params = Promise<{ slug: string }>;

export const revalidate = 3600;

export async function generateMetadata(
{ params }: { params: Params },
Expand Down Expand Up @@ -48,12 +46,6 @@ export async function generateMetadata(
} satisfies Metadata;
}

export async function generateStaticParams() {
const slugs = await client.fetch<string[]>(
groq`*[_type == "author" && defined(slug.current)].slug.current`,
);
return slugs.map((slug) => ({ slug }));
}

export default async function AuthorPage({ params }: { params: Params }) {
const { slug } = await params;
Expand Down
11 changes: 0 additions & 11 deletions app/(main)/(author)/authors/page/[num]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
import MoreContent from "@/components/more-content";
import type { DocCountResult } from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";

import PaginateList from "@/components/paginate-list";
import { docCount } from "@/sanity/lib/queries";
import { groq } from "next-sanity";

const LIMIT = 10;

type Params = Promise<{ num: string }>;

export const revalidate = 60;

export async function generateStaticParams() {
const count = await client.fetch<number>(
groq`count(*[_type == "author" && defined(slug.current)])`,
);
const perPage = LIMIT;
const pages = Math.ceil(count / perPage);
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
}

export default async function Page({ params }: { params: Params }) {
const { num } = await params;
Expand Down
10 changes: 1 addition & 9 deletions app/(main)/(guest)/guest/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Metadata, ResolvingMetadata } from "next";
import { groq, type PortableTextBlock } from "next-sanity";
import { type PortableTextBlock } from "next-sanity";
import { notFound } from "next/navigation";

import PortableText from "@/components/portable-text";
Expand All @@ -9,7 +9,6 @@ import type {
GuestQueryWithRelatedResult,
} from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";
import { guestQuery, guestQueryWithRelated } from "@/sanity/lib/queries";
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
import CoverMedia from "@/components/cover-media";
Expand All @@ -21,7 +20,6 @@ import Avatar from "@/components/avatar";

type Params = Promise<{ slug: string }>;

export const revalidate = 3600;

export async function generateMetadata(
{ params }: { params: Params },
Expand All @@ -48,12 +46,6 @@ export async function generateMetadata(
} satisfies Metadata;
}

export async function generateStaticParams() {
const slugs = await client.fetch<string[]>(
groq`*[_type == "guest" && defined(slug.current)].slug.current`,
);
return slugs.map((slug) => ({ slug }));
}

export default async function GuestPage({ params }: { params: Params }) {
const { slug } = await params;
Expand Down
11 changes: 0 additions & 11 deletions app/(main)/(guest)/guests/page/[num]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
import MoreContent from "@/components/more-content";
import type { DocCountResult } from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";

import PaginateList from "@/components/paginate-list";
import { docCount } from "@/sanity/lib/queries";
import { groq } from "next-sanity";

const LIMIT = 10;

type Params = Promise<{ num: string }>;

export const revalidate = 60;

export async function generateStaticParams() {
const count = await client.fetch<number>(
groq`count(*[_type == "guest" && defined(slug.current)])`,
);
const perPage = LIMIT;
const pages = Math.ceil(count / perPage);
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
}

export default async function Page({ params }: { params: Params }) {
const [count] = (
Expand Down
9 changes: 0 additions & 9 deletions app/(main)/(podcast)/podcast/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ import type { Metadata, ResolvingMetadata } from "next";
import { notFound } from "next/navigation";
import type { PodcastQueryResult } from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";
import { podcastQuery } from "@/sanity/lib/queries";
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
import Podcast from "../Podcast";
import { groq } from "next-sanity";

type Params = Promise<{ slug: string }>;

export const revalidate = 3600;

export async function generateMetadata(
{ params }: { params: Params },
Expand Down Expand Up @@ -41,12 +38,6 @@ export async function generateMetadata(
} satisfies Metadata;
}

export async function generateStaticParams() {
const slugs = await client.fetch<string[]>(
groq`*[_type == "podcast" && defined(slug.current)].slug.current`,
);
return slugs.map((slug) => ({ slug }));
}

export default async function PodcastPage({ params }: { params: Params }) {
const { slug } = await params;
Expand Down
1 change: 0 additions & 1 deletion app/(main)/(podcast)/podcasts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import MoreHeader from "@/components/more-header";

import PodmatchBadge from "@/components/podmatch-badge";

export const revalidate = 60;
function HeroPodcast({
title,
slug,
Expand Down
11 changes: 0 additions & 11 deletions app/(main)/(podcast)/podcasts/page/[num]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
import MoreContent from "@/components/more-content";
import type { DocCountResult } from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";

import PaginateList from "@/components/paginate-list";
import { docCount } from "@/sanity/lib/queries";
import { groq } from "next-sanity";

const LIMIT = 10;

type Params = Promise<{ num: string }>;

export const revalidate = 60;

export async function generateStaticParams() {
const count = await client.fetch<number>(
groq`count(*[_type == "podcast" && defined(slug.current)])`,
);
const perPage = LIMIT;
const pages = Math.ceil(count / perPage);
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
}

export default async function Page({ params }: { params: Params }) {
const [count] = (
Expand Down
1 change: 0 additions & 1 deletion app/(main)/(post)/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Separator } from "@/components/ui/separator";

import MoreHeader from "@/components/more-header";

export const revalidate = 60;
function HeroPost({
title,
slug,
Expand Down
11 changes: 0 additions & 11 deletions app/(main)/(post)/blog/page/[num]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
import MoreContent from "@/components/more-content";
import type { DocCountResult } from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";

import PaginateList from "@/components/paginate-list";
import { docCount } from "@/sanity/lib/queries";
import { groq } from "next-sanity";

const LIMIT = 10;

type Params = Promise<{ num: string }>;

export const revalidate = 60;

export async function generateStaticParams() {
const count = await client.fetch<number>(
groq`count(*[_type == "post" && defined(slug.current)])`,
);
const perPage = LIMIT;
const pages = Math.ceil(count / perPage);
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
}

export default async function Page({ params }: { params: Params }) {
const [count] = (
Expand Down
10 changes: 1 addition & 9 deletions app/(main)/(post)/post/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Metadata, ResolvingMetadata } from "next";
import { groq, type PortableTextBlock } from "next-sanity";
import { type PortableTextBlock } from "next-sanity";
import { notFound } from "next/navigation";
import { Suspense } from "react";

Expand All @@ -10,7 +10,6 @@ import PortableText from "@/components/portable-text";

import type { PostQueryResult } from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";
import { postQuery } from "@/sanity/lib/queries";
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
import CoverMedia from "@/components/cover-media";
Expand All @@ -20,7 +19,6 @@ import SponsorCard from "@/components/sponsor-card";

type Params = Promise<{ slug: string }>;

export const revalidate = 3600;

export async function generateMetadata(
{ params }: { params: Params },
Expand Down Expand Up @@ -51,12 +49,6 @@ export async function generateMetadata(
} satisfies Metadata;
}

export async function generateStaticParams() {
const slugs = await client.fetch<string[]>(
groq`*[_type == "post" && defined(slug.current)].slug.current`,
);
return slugs.map((slug) => ({ slug }));
}

export default async function PostPage({ params }: { params: Params }) {
const { slug } = await params;
Expand Down
10 changes: 1 addition & 9 deletions app/(main)/(sponsor)/sponsor/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Metadata, ResolvingMetadata } from "next";
import { groq, type PortableTextBlock } from "next-sanity";
import { type PortableTextBlock } from "next-sanity";
import { notFound } from "next/navigation";

import PortableText from "@/components/portable-text";
Expand All @@ -9,7 +9,6 @@ import type {
SponsorQueryWithRelatedResult,
} from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";
import { sponsorQuery, sponsorQueryWithRelated } from "@/sanity/lib/queries";
import { resolveOpenGraphImage } from "@/sanity/lib/utils";
import CoverMedia from "@/components/cover-media";
Expand All @@ -20,7 +19,6 @@ import UserRelated from "@/components/user-related";

type Params = Promise<{ slug: string }>;

export const revalidate = 3600;

export async function generateMetadata(
{ params }: { params: Params },
Expand All @@ -47,12 +45,6 @@ export async function generateMetadata(
} satisfies Metadata;
}

export async function generateStaticParams() {
const slugs = await client.fetch<string[]>(
groq`*[_type == "sponsor" && defined(slug.current)].slug.current`,
);
return slugs.map((slug) => ({ slug }));
}

export default async function SponsorPage({ params }: { params: Params }) {
const { slug } = await params;
Expand Down
11 changes: 0 additions & 11 deletions app/(main)/(sponsor)/sponsors/page/[num]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,15 @@ import Link from "next/link";
import MoreContent from "@/components/more-content";
import type { DocCountResult } from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";

import PaginateList from "@/components/paginate-list";
import { docCount } from "@/sanity/lib/queries";
import { groq } from "next-sanity";

const LIMIT = 10;

type Params = Promise<{ num: string }>;

export const revalidate = 60;

export async function generateStaticParams() {
const count = await client.fetch<number>(
groq`count(*[_type == "sponsor" && defined(slug.current)])`,
);
const perPage = LIMIT;
const pages = Math.ceil(count / perPage);
return Array.from({ length: pages }, (_, i) => ({ num: String(i + 1) }));
}

export default async function Page({ params }: { params: Params }) {
const [count] = (
Expand Down
10 changes: 1 addition & 9 deletions app/(main)/(top-level-pages)/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { Metadata, ResolvingMetadata } from "next";
import { groq, type PortableTextBlock } from "next-sanity";
import { type PortableTextBlock } from "next-sanity";
import { notFound } from "next/navigation";

import PortableText from "@/components/portable-text";

import type { PageQueryResult } from "@/sanity/types";
import { sanityFetch } from "@/sanity/lib/live";
import { client } from "@/sanity/lib/client";
import { pageQuery } from "@/sanity/lib/queries";
import { resolveOpenGraphImage } from "@/sanity/lib/utils";

Expand All @@ -15,7 +14,6 @@ type Props = {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
};

export const revalidate = 86400;

export async function generateMetadata(
{ params, searchParams }: Props,
Expand All @@ -42,12 +40,6 @@ export async function generateMetadata(
} satisfies Metadata;
}

export async function generateStaticParams() {
const slugs = await client.fetch<string[]>(
groq`*[_type == "page" && defined(slug.current)].slug.current`,
);
return slugs.map((slug) => ({ slug }));
}

export default async function PagePage({ params, searchParams }: Props) {
const { slug } = await params;
Expand Down
1 change: 0 additions & 1 deletion app/(main)/(top-level-pages)/pro/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type Props = {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
};

export const revalidate = 86400;

export async function generateMetadata(
{ params, searchParams }: Props,
Expand Down
1 change: 0 additions & 1 deletion app/(main)/(top-level-pages)/sponsorships/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { resolveOpenGraphImage } from "@/sanity/lib/utils";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { SponsorshipForm } from "./sponsorship-form";

export const revalidate = 86400;
const sponsorshipTiers = [
{
name: "Dedicated Video",
Expand Down
1 change: 0 additions & 1 deletion app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { homePageQuery } from "@/sanity/lib/queries";
import Link from "next/link";
import CoverMedia from "@/components/cover-media";

export const revalidate = 60;

export default async function HomePage() {
const [homePageFetch] = await Promise.all([
Expand Down
Loading