Skip to content
Merged
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
4 changes: 2 additions & 2 deletions app/(public)/agent/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PostCard } from "@/components/post/PostCard";
import { EmptyState } from "@/components/ui/EmptyState";
import { AGENTS } from "@/lib/constants/agents";
import { fetchPostsByAgent } from "@/lib/db/posts";
import { getSiteUrl } from "@/lib/utils/urls";

export const revalidate = 60;

Expand All @@ -17,8 +18,7 @@ export async function generateMetadata({
}: PageProps): Promise<Metadata> {
const agent = AGENTS.find((a) => a.slug === params.slug);
if (!agent) return { title: "Agent Not Found" };
const siteUrl =
process.env.NEXT_PUBLIC_SITE_URL ?? "https://agentpostmortem.com";
const siteUrl = getSiteUrl();
const ogImageUrl = `${siteUrl}/api/og/agent/${params.slug}`;
return {
title: `${agent.name} Failure Cases`,
Expand Down
6 changes: 2 additions & 4 deletions app/(public)/case/[caseNumber]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export async function generateMetadata({
const title = post ? post.title : `Case ${caseNum}`;
const description =
post?.outcome?.slice(0, 160) ?? `AI agent failure case file ${caseNum}`;
const siteUrl =
process.env.NEXT_PUBLIC_SITE_URL ?? "https://agentpostmortem.com";
const siteUrl = getSiteUrl();
const ogImageUrl = `${siteUrl}/api/og/${caseNum}`;

return {
Expand Down Expand Up @@ -99,8 +98,7 @@ export default async function CasePage({ params }: PageProps) {
: `$${post.estimatedCostUsd}`
: null;

const siteUrl =
process.env.NEXT_PUBLIC_SITE_URL ?? "https://agentpostmortem.com";
const siteUrl = getSiteUrl();
const sourceDomain = getSourceDomain(post.sourceUrl);
const articleJsonLd = {
"@context": "https://schema.org",
Expand Down
4 changes: 2 additions & 2 deletions app/(public)/tag/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PostCard } from "@/components/post/PostCard";
import { EmptyState } from "@/components/ui/EmptyState";
import { TAGS } from "@/lib/constants/tags";
import { fetchPostsByTag } from "@/lib/db/posts";
import { getSiteUrl } from "@/lib/utils/urls";

export const revalidate = 60;

Expand All @@ -17,8 +18,7 @@ export async function generateMetadata({
}: PageProps): Promise<Metadata> {
const tag = TAGS.find((t) => t.slug === params.slug);
if (!tag) return { title: "Tag Not Found" };
const siteUrl =
process.env.NEXT_PUBLIC_SITE_URL ?? "https://agentpostmortem.com";
const siteUrl = getSiteUrl();
const ogImageUrl = `${siteUrl}/api/og/tag/${params.slug}`;
return {
title: `#${tag.label} — AI Agent Failures`,
Expand Down
4 changes: 2 additions & 2 deletions app/feed.xml/route.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createSupabaseAdminClient } from "@/lib/supabase/admin";
import { getSiteUrl } from "@/lib/utils/urls";

export const dynamic = "force-dynamic";
export const revalidate = 3600;

export async function GET() {
const siteUrl =
process.env.NEXT_PUBLIC_SITE_URL ?? "https://agentpostmortem.com";
const siteUrl = getSiteUrl();
const supabase = createSupabaseAdminClient();

const { data: posts } = await supabase
Expand Down
4 changes: 2 additions & 2 deletions app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { MetadataRoute } from "next";
import { getSiteUrl } from "@/lib/utils/urls";

export default function robots(): MetadataRoute.Robots {
const siteUrl =
process.env.NEXT_PUBLIC_SITE_URL ?? "https://agentpostmortem.com";
const siteUrl = getSiteUrl();
return {
rules: {
userAgent: "*",
Expand Down
4 changes: 2 additions & 2 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { MetadataRoute } from "next";
import { createSupabaseAdminClient } from "@/lib/supabase/admin";
import { AGENTS } from "@/lib/constants/agents";
import { TAGS } from "@/lib/constants/tags";
import { getSiteUrl } from "@/lib/utils/urls";

export const dynamic = "force-dynamic";

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const siteUrl =
process.env.NEXT_PUBLIC_SITE_URL ?? "https://agentpostmortem.com";
const siteUrl = getSiteUrl();
const supabase = createSupabaseAdminClient();

const { data: posts } = await supabase
Expand Down
Loading