diff --git a/workspaces/cms-config/src/collections/posts.ts b/workspaces/cms-config/src/collections/posts.ts index a7e3ad308f..2f4db752fb 100644 --- a/workspaces/cms-config/src/collections/posts.ts +++ b/workspaces/cms-config/src/collections/posts.ts @@ -133,6 +133,22 @@ export const postsCollectionConfig = { label: "Short Description", widget: "text", }, + { + required: false, + name: "seoFocusKeywords", + label: "Seo focus keywords", + hint: "Enter the focus keywords separated by commas", + widget: 'list', + crowdin: true, + }, + { + required: false, + name: "seoCanonicalUrl", + label: "Seo Canonical url", + hint: "If the article was lifted from somewhere else, you can link it here", + widget: 'string', + crowdin: true, + }, { name: "blocks", label: "Blocks", diff --git a/workspaces/cms-config/src/collections/roadmapPosts.ts b/workspaces/cms-config/src/collections/roadmapPosts.ts index e75f1a6cfa..fcc985b9c6 100644 --- a/workspaces/cms-config/src/collections/roadmapPosts.ts +++ b/workspaces/cms-config/src/collections/roadmapPosts.ts @@ -46,6 +46,29 @@ export const roadmapPostsCollectionConfig = { widget: "string", crowdin: true, }, + { + 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: "availability", label: "Availability", diff --git a/workspaces/cms-config/src/collections/tutorials.ts b/workspaces/cms-config/src/collections/tutorials.ts index 460cb634ee..3170a98895 100644 --- a/workspaces/cms-config/src/collections/tutorials.ts +++ b/workspaces/cms-config/src/collections/tutorials.ts @@ -54,6 +54,29 @@ export const tutorialsCollectionConfig = { widget: "string", crowdin: true }, + { + 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: "authors", label: "Authors", diff --git a/workspaces/website/src/renderer/_default.page.server.tsx b/workspaces/website/src/renderer/_default.page.server.tsx index fb67c75e71..99fb2b9b47 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, SeoType } from "./types"; +import { DocumentProps, PageContextServer, SeoType } from "./types"; import { PageShell } from "./PageShell"; import { getDefaultPageContext } from "./helpers"; import type { InjectFilterEntry } from "vite-plugin-ssr/types"; @@ -41,9 +41,9 @@ export async function render(pageContext: PageContextServer) { }); const GOOGLE_TAG_ID = "G-WY42TERK5P"; - const pageSeo = pageProps?.data as SeoType + const pageSeo = (pageProps?.data ?? pageProps?.roadmapPost ?? pageProps?.tutorial) as SeoType const documentProps = - pageContext.documentProps ?? pageContext.exports.documentProps; + pageContext.documentProps ?? pageContext.exports.documentProps const title = documentProps?.title ?? pageSeo?.seoTitle ? `${documentProps?.title ?? pageSeo?.seoTitle} - Starknet` @@ -115,6 +115,10 @@ export async function render(pageContext: PageContextServer) { a.appendChild(r); })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); + + ${pageSeo?.seoCanonicalUrl ? ` + + `: ''}