Resolve share URLs from the instance host and ship 1200×630 Open Graph images.
Staging no longer advertises production canonicals, and Slack/social previews get a default hero card with template and article overrides. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
47625b1c82
commit
751f2e9343
22 files changed
+340
-16
No files matched your search
@@ -1,13 +1,19 @@
|
||||
import type { Metadata } from "next";
|
||||
import messages from "../../../../messages/en/index";
|
||||
import { listRuleTemplatesFromDb } from "../../../../lib/server/ruleTemplates";
|
||||
import { routeMetadata } from "../../../../lib/siteMetadata";
|
||||
import {
|
||||
routeMetadata,
|
||||
templatesShareImages,
|
||||
} from "../../../../lib/siteMetadata";
|
||||
import { gridEntriesForFullCatalogWithFallback } from "../../../../lib/templates/templateGridPresentation";
|
||||
import { CREATE_ROUTES } from "../utils/createFlowPaths";
|
||||
import { CreateFlowTemplatesPageClient } from "./CreateFlowTemplatesPageClient";
|
||||
|
||||
export const metadata: Metadata = routeMetadata(CREATE_ROUTES.templatesPicker, {
|
||||
title: messages.metadata.templates.title,
|
||||
openGraph: {
|
||||
images: templatesShareImages(),
|
||||
},
|
||||
});
|
||||
|
||||
/** In-flow template catalog after review “Create from template”. */
|
||||
|
||||
@@ -8,7 +8,10 @@ import {
|
||||
getRelatedBlogPosts,
|
||||
} from "../../../../lib/content";
|
||||
import { logger } from "../../../../lib/logger";
|
||||
import { routeMetadata } from "../../../../lib/siteMetadata";
|
||||
import {
|
||||
articleShareImages,
|
||||
routeMetadata,
|
||||
} from "../../../../lib/siteMetadata";
|
||||
import messages from "../../../../messages/en/index";
|
||||
import ContentBanner from "../../../components/sections/ContentBanner";
|
||||
import AskOrganizer from "../../../components/sections/AskOrganizer";
|
||||
@@ -70,6 +73,11 @@ export async function generateMetadata({
|
||||
});
|
||||
}
|
||||
|
||||
const articleImages = articleShareImages(
|
||||
slug,
|
||||
post.frontmatter.title,
|
||||
);
|
||||
|
||||
return routeMetadata(`/blog/${slug}`, {
|
||||
title: post.frontmatter.title,
|
||||
description: post.frontmatter.description,
|
||||
@@ -82,6 +90,7 @@ export async function generateMetadata({
|
||||
authors: [post.frontmatter.author],
|
||||
url: `/blog/${slug}`,
|
||||
siteName: messages.metadata.siteName,
|
||||
...(articleImages ? { images: articleImages } : {}),
|
||||
},
|
||||
twitter: {
|
||||
card: "summary_large_image",
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
import type { Metadata } from "next";
|
||||
import messages from "../../../messages/en/index";
|
||||
import { listRuleTemplatesFromDb } from "../../../lib/server/ruleTemplates";
|
||||
import { routeMetadata } from "../../../lib/siteMetadata";
|
||||
import {
|
||||
routeMetadata,
|
||||
templatesShareImages,
|
||||
} from "../../../lib/siteMetadata";
|
||||
import { gridEntriesForFullCatalogWithFallback } from "../../../lib/templates/templateGridPresentation";
|
||||
import TemplatesPageClient from "./TemplatesPageClient";
|
||||
|
||||
export const metadata: Metadata = routeMetadata("/templates", {
|
||||
title: messages.metadata.templates.title,
|
||||
openGraph: {
|
||||
images: templatesShareImages(),
|
||||
},
|
||||
});
|
||||
|
||||
export default async function TemplatesPage() {
|
||||
|
||||
+8
-3
@@ -3,7 +3,10 @@ import type { Metadata, Viewport } from "next";
|
||||
import type { ReactNode } from "react";
|
||||
import messages from "../messages/en/index";
|
||||
import { ASSETS, getAssetPath } from "../lib/assetUtils";
|
||||
import { PRODUCTION_SITE_ORIGIN } from "../lib/siteMetadata";
|
||||
import {
|
||||
defaultShareImages,
|
||||
metadataBaseUrl,
|
||||
} from "../lib/siteMetadata";
|
||||
import "./globals.css";
|
||||
|
||||
// Session chrome (`ConditionalNavigation`) lives in `(marketing)`, `(app)`, and
|
||||
@@ -68,7 +71,7 @@ export const metadata: Metadata = {
|
||||
address: false,
|
||||
telephone: false,
|
||||
},
|
||||
metadataBase: new URL(PRODUCTION_SITE_ORIGIN),
|
||||
metadataBase: metadataBaseUrl(),
|
||||
icons: {
|
||||
icon: [
|
||||
{ url: getAssetPath(ASSETS.LOGO), type: "image/svg+xml" },
|
||||
@@ -95,15 +98,17 @@ export const metadata: Metadata = {
|
||||
openGraph: {
|
||||
title: homeMeta.title,
|
||||
description: homeMeta.description,
|
||||
url: PRODUCTION_SITE_ORIGIN,
|
||||
url: "/",
|
||||
siteName: messages.metadata.siteName,
|
||||
locale: "en_US",
|
||||
type: "website",
|
||||
images: defaultShareImages(),
|
||||
},
|
||||
twitter: {
|
||||
card: "summary_large_image",
|
||||
title: homeMeta.title,
|
||||
description: homeMeta.description,
|
||||
images: defaultShareImages().map((image) => image.url),
|
||||
},
|
||||
robots: {
|
||||
index: true,
|
||||
|
||||
Reference in new issue
Block a user