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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const alt = "Agentic design pattern reference card";
export const size = { width: 1200, height: 630 };
export const contentType = "image/png";

const SITE_DOMAIN = process.env.NEXT_PUBLIC_SERVER_URL
? new URL(process.env.NEXT_PUBLIC_SERVER_URL).hostname
: "detached-node.dev";

// Pre-bake one OG image per non-archived pattern at build time.
export async function generateStaticParams(): Promise<{ slug: string }[]> {
return getPatternSlugs().map((slug) => ({ slug }));
Expand Down Expand Up @@ -128,7 +132,7 @@ export default async function OgImage({ params }: OgImageProps) {
}}
>
<span>Agentic Design Patterns</span>
<span>detached-node.com</span>
<span>{SITE_DOMAIN}</span>
</div>
</div>
),
Expand Down
12 changes: 3 additions & 9 deletions src/app/(frontend)/agentic-design-patterns/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,9 @@ export default async function PatternSatellitePage({
/>
<ReferencesSection pattern={pattern} />
{overviewLead && (
<DisclosureSection
id="overview-discussion"
label="Overview · 1-paragraph mechanism"
defaultOpen
>
<p className="text-base leading-7 text-text-secondary [text-wrap:pretty]">
{overviewLead}
</p>
</DisclosureSection>
<p className="text-base leading-7 text-text-secondary [text-wrap:pretty]">
{overviewLead}
</p>
)}
{backgroundParagraphs.length > 0 && (
<DisclosureSection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export const alt = "Agentic Design Patterns reference catalog";
export const size = { width: 1200, height: 630 };
export const contentType = "image/png";

const SITE_DOMAIN = process.env.NEXT_PUBLIC_SERVER_URL
? new URL(process.env.NEXT_PUBLIC_SERVER_URL).hostname
: "detached-node.dev";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both [slug]/opengraph-image.tsx and opengraph-image.tsx now carry an identical SITE_DOMAIN block with the same "detached-node.dev" literal. If the canonical domain ever changes — or a future env-handling refactor lands — both files need to be edited in lockstep, and there is no compile-time link between them.

Low-cost polish: lift the fallback into src/lib/site-config.ts (alongside siteName, siteAuthor, the new CONTACT_EMAIL, etc.) and import it. That avoids the assertRequiredEnv indirection that the file-header comments deliberately avoid — a plain string export does not transitively touch process.env in the bundle graph, so the Satori/edge concern those comments cite stays addressed.

Non-blocking — the duplication is two lines, the convergence cost is small, and you may prefer the file-local readability. Flagging because the rest of this PR is consolidating site-identity constants and this is the same theme.


export default async function OgImage() {
const subtitle = "A reference catalog of agentic AI design patterns.";
const footerStat = "5 layers · reference catalog";
Expand Down Expand Up @@ -106,7 +110,7 @@ export default async function OgImage() {
}}
>
<span>{footerStat}</span>
<span>detached-node.com</span>
<span>{SITE_DOMAIN}</span>
</div>
</div>
),
Expand Down
8 changes: 0 additions & 8 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
url: siteUrl,
lastModified: new Date(),
changeFrequency: "weekly",
priority: 1,
},
{
url: `${siteUrl}/posts`,
lastModified: new Date(),
changeFrequency: "daily",
priority: 0.9,
},
{
url: `${siteUrl}/about`,
lastModified: new Date(),
changeFrequency: "monthly",
priority: 0.8,
},
];

Expand All @@ -32,13 +29,11 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
url: `${siteUrl}/agentic-design-patterns`,
lastModified: new Date(),
changeFrequency: "weekly",
priority: 0.95,
},
{
url: `${siteUrl}/agentic-design-patterns/changelog`,
lastModified: new Date(),
changeFrequency: "weekly",
priority: 0.7,
},
];
const adpSatelliteRoutes: MetadataRoute.Sitemap = PATTERNS.filter(
Expand All @@ -47,7 +42,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
url: `${siteUrl}/agentic-design-patterns/${p.slug}`,
lastModified: new Date(p.dateModified),
changeFrequency: "monthly" as const,
priority: 0.85,
}));

// Fetch published posts
Expand All @@ -56,7 +50,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
url: `${siteUrl}/posts/${post.slug}`,
lastModified: new Date(post.updatedAt),
changeFrequency: "weekly" as const,
priority: 0.7,
}));

// Fetch published pages
Expand All @@ -67,7 +60,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
url: `${siteUrl}/${page.slug}`,
lastModified: new Date(page.updatedAt),
changeFrequency: "monthly" as const,
priority: 0.6,
}));

return [
Expand Down
7 changes: 7 additions & 0 deletions src/components/agentic-patterns/PatternHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import type { LayerId, Pattern } from "@/data/agentic-design-patterns/types";
import { LAYERS } from "@/data/agentic-design-patterns/layers";
import { formatDate } from "@/lib/formatting";

interface PatternHeaderProps {
pattern: Pattern;
Expand Down Expand Up @@ -49,6 +50,12 @@ export function PatternHeader({ pattern }: PatternHeaderProps) {
{pattern.oneLineSummary}
</p>
)}
<time
dateTime={pattern.dateModified}
className="text-sm tracking-[0.03em] text-text-tertiary"
>
Last edited {formatDate(pattern.dateModified)}
</time>
</header>
);
}
2 changes: 1 addition & 1 deletion src/lib/schema/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ export const AUTHOR_CONFIG = {
// sameAs: external verifiable profiles for entity disambiguation.
// GitHub org is the one confirmed external reference at launch.
// Add LinkedIn/Twitter/etc. when/if disclosed.
sameAs: ["https://github.com/detached-node"] as string[],
sameAs: ["https://github.com/julianken"] as string[],
description: "Writing on agentic AI in software engineering.",
} as const;
2 changes: 2 additions & 0 deletions src/lib/site-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const siteDescription =

export const siteAuthor = "detached-node";

export const CONTACT_EMAIL = "julian.kennon.d@gmail.com";

export const siteKeywords = [
"agentic AI",
"autonomous systems",
Expand Down
Loading