diff --git a/workspaces/cms-config/src/collections/pages.ts b/workspaces/cms-config/src/collections/pages.ts index 266bace947..3e555db414 100644 --- a/workspaces/cms-config/src/collections/pages.ts +++ b/workspaces/cms-config/src/collections/pages.ts @@ -30,6 +30,29 @@ export const pagesCollectionConfig = { label: "Show title", widget: "boolean" }, + { + required: false, + name: "seoTitle", + label: "Seo title", + hint: "If empty the title field will be used", + widget: "string", + crowdin: true, + }, + { + required: false, + name: "seoDescription", + label: "Seo description", + widget: "string", + crowdin: true, + }, + { + required: false, + name: "seoFocusKeywords", + label: "Seo focus keywords", + hint: "Enter the focus keywords separated by commas", + widget: 'list', + crowdin: true, + }, { name: "template", widget: "select", diff --git a/workspaces/website/src/renderer/_default.page.server.tsx b/workspaces/website/src/renderer/_default.page.server.tsx index 414055c207..fb67c75e71 100644 --- a/workspaces/website/src/renderer/_default.page.server.tsx +++ b/workspaces/website/src/renderer/_default.page.server.tsx @@ -1,6 +1,6 @@ import { renderToStream } from "react-streaming/server"; import { escapeInject } from "vite-plugin-ssr/server"; -import { PageContextServer } from "./types"; +import { PageContextServer, SeoType } from "./types"; import { PageShell } from "./PageShell"; import { getDefaultPageContext } from "./helpers"; import type { InjectFilterEntry } from "vite-plugin-ssr/types"; @@ -41,20 +41,23 @@ export async function render(pageContext: PageContextServer) { }); const GOOGLE_TAG_ID = "G-WY42TERK5P"; + const pageSeo = pageProps?.data as SeoType const documentProps = pageContext.documentProps ?? pageContext.exports.documentProps; - const title = documentProps?.title - ? `${documentProps?.title} - Starknet` + const title = documentProps?.title ?? pageSeo?.seoTitle + ? `${documentProps?.title ?? pageSeo?.seoTitle} - Starknet` : "Starknet"; const description = - documentProps?.description ?? + documentProps?.description ?? pageSeo?.seoDescription as string ?? "Starknet is the secure scaling technology bringing Ethereum’s benefits to the world."; const image = documentProps?.image ?? `${import.meta.env.VITE_SITE_URL}/assets/share/generic_landing.png`; + + const focusKeywords = pageSeo?.seoFocusKeywords as string[] const documentHtml = escapeInject` @@ -66,6 +69,7 @@ export async function render(pageContext: PageContextServer) {