|
1 | 1 | import { Analytics } from '@vercel/analytics/next' |
2 | 2 | import { SpeedInsights } from '@vercel/speed-insights/next' |
3 | | -import { GeistSans } from 'geist/font/sans' |
4 | 3 | import type { Metadata, Viewport } from 'next' |
5 | 4 | import { PublicEnvScript } from 'next-runtime-env' |
| 5 | +import { BrandedLayout } from '@/components/branded-layout' |
| 6 | +import { generateBrandedMetadata, generateStructuredData } from '@/lib/branding/metadata' |
| 7 | +import { env } from '@/lib/env' |
6 | 8 | import { isHosted } from '@/lib/environment' |
7 | 9 | import { createLogger } from '@/lib/logs/console/logger' |
8 | 10 | import { getAssetUrl } from '@/lib/utils' |
@@ -51,149 +53,20 @@ export const viewport: Viewport = { |
51 | 53 | userScalable: false, |
52 | 54 | } |
53 | 55 |
|
54 | | -export const metadata: Metadata = { |
55 | | - title: { |
56 | | - template: '', |
57 | | - default: 'Sim', |
58 | | - }, |
59 | | - description: |
60 | | - 'Build and deploy AI agents using our Figma-like canvas. Build, write evals, and deploy AI agent workflows that automate workflows and streamline your business processes.', |
61 | | - applicationName: 'Sim', |
62 | | - authors: [{ name: 'Sim' }], |
63 | | - generator: 'Next.js', |
64 | | - keywords: [ |
65 | | - 'AI agent', |
66 | | - 'AI agent builder', |
67 | | - 'AI agent workflow', |
68 | | - 'AI workflow automation', |
69 | | - 'visual workflow editor', |
70 | | - 'AI agents', |
71 | | - 'workflow canvas', |
72 | | - 'intelligent automation', |
73 | | - 'AI tools', |
74 | | - 'workflow designer', |
75 | | - 'artificial intelligence', |
76 | | - 'business automation', |
77 | | - 'AI agent workflows', |
78 | | - 'visual programming', |
79 | | - ], |
80 | | - referrer: 'origin-when-cross-origin', |
81 | | - creator: 'Sim', |
82 | | - publisher: 'Sim', |
83 | | - metadataBase: new URL('https://sim.ai'), |
84 | | - alternates: { |
85 | | - canonical: '/', |
86 | | - languages: { |
87 | | - 'en-US': '/en-US', |
88 | | - }, |
89 | | - }, |
90 | | - robots: { |
91 | | - index: true, |
92 | | - follow: true, |
93 | | - googleBot: { |
94 | | - index: true, |
95 | | - follow: true, |
96 | | - 'max-image-preview': 'large', |
97 | | - 'max-video-preview': -1, |
98 | | - 'max-snippet': -1, |
99 | | - }, |
100 | | - }, |
101 | | - openGraph: { |
102 | | - type: 'website', |
103 | | - locale: 'en_US', |
104 | | - url: 'https://sim.ai', |
105 | | - title: 'Sim', |
106 | | - description: |
107 | | - 'Build and deploy AI agents using our Figma-like canvas. Build, write evals, and deploy AI agent workflows that automate workflows and streamline your business processes.', |
108 | | - siteName: 'Sim', |
109 | | - images: [ |
110 | | - { |
111 | | - url: getAssetUrl('social/facebook.png'), |
112 | | - width: 1200, |
113 | | - height: 630, |
114 | | - alt: 'Sim', |
115 | | - }, |
116 | | - ], |
117 | | - }, |
118 | | - twitter: { |
119 | | - card: 'summary_large_image', |
120 | | - title: 'Sim', |
121 | | - description: |
122 | | - 'Build and deploy AI agents using our Figma-like canvas. Build, write evals, and deploy AI agent workflows that automate workflows and streamline your business processes.', |
123 | | - images: [getAssetUrl('social/twitter.png')], |
124 | | - creator: '@simstudioai', |
125 | | - site: '@simstudioai', |
126 | | - }, |
127 | | - manifest: '/favicon/site.webmanifest', |
128 | | - icons: { |
129 | | - icon: [ |
130 | | - { url: '/favicon/favicon-16x16.png', sizes: '16x16', type: 'image/png' }, |
131 | | - { url: '/favicon/favicon-32x32.png', sizes: '32x32', type: 'image/png' }, |
132 | | - { |
133 | | - url: '/favicon/favicon-192x192.png', |
134 | | - sizes: '192x192', |
135 | | - type: 'image/png', |
136 | | - }, |
137 | | - { |
138 | | - url: '/favicon/favicon-512x512.png', |
139 | | - sizes: '512x512', |
140 | | - type: 'image/png', |
141 | | - }, |
142 | | - { url: '/sim.png', sizes: 'any', type: 'image/png' }, |
143 | | - ], |
144 | | - apple: '/favicon/apple-touch-icon.png', |
145 | | - shortcut: '/favicon/favicon.ico', |
146 | | - }, |
147 | | - appleWebApp: { |
148 | | - capable: true, |
149 | | - statusBarStyle: 'default', |
150 | | - title: 'Sim', |
151 | | - }, |
152 | | - formatDetection: { |
153 | | - telephone: false, |
154 | | - }, |
155 | | - category: 'technology', |
156 | | - other: { |
157 | | - 'apple-mobile-web-app-capable': 'yes', |
158 | | - 'mobile-web-app-capable': 'yes', |
159 | | - 'msapplication-TileColor': '#ffffff', |
160 | | - 'msapplication-config': '/favicon/browserconfig.xml', |
161 | | - }, |
162 | | -} |
| 56 | +// Generate dynamic metadata based on brand configuration |
| 57 | +export const metadata: Metadata = generateBrandedMetadata() |
163 | 58 |
|
164 | 59 | export default function RootLayout({ children }: { children: React.ReactNode }) { |
| 60 | + const structuredData = generateStructuredData() |
| 61 | + |
165 | 62 | return ( |
166 | | - <html lang='en' suppressHydrationWarning className={GeistSans.className}> |
| 63 | + <html lang='en' suppressHydrationWarning> |
167 | 64 | <head> |
168 | 65 | {/* Structured Data for SEO */} |
169 | 66 | <script |
170 | 67 | type='application/ld+json' |
171 | 68 | dangerouslySetInnerHTML={{ |
172 | | - __html: JSON.stringify({ |
173 | | - '@context': 'https://schema.org', |
174 | | - '@type': 'SoftwareApplication', |
175 | | - name: 'Sim', |
176 | | - description: |
177 | | - 'Build and deploy AI agents using our Figma-like canvas. Build, write evals, and deploy AI agent workflows that automate workflows and streamline your business processes.', |
178 | | - url: 'https://sim.ai', |
179 | | - applicationCategory: 'BusinessApplication', |
180 | | - operatingSystem: 'Web Browser', |
181 | | - offers: { |
182 | | - '@type': 'Offer', |
183 | | - category: 'SaaS', |
184 | | - }, |
185 | | - creator: { |
186 | | - '@type': 'Organization', |
187 | | - name: 'Sim', |
188 | | - url: 'https://sim.ai', |
189 | | - }, |
190 | | - featureList: [ |
191 | | - 'Visual AI Agent Builder', |
192 | | - 'Workflow Canvas Interface', |
193 | | - 'AI Agent Automation', |
194 | | - 'Custom AI Workflows', |
195 | | - ], |
196 | | - }), |
| 69 | + __html: JSON.stringify(structuredData), |
197 | 70 | }} |
198 | 71 | /> |
199 | 72 |
|
@@ -226,24 +99,26 @@ export default function RootLayout({ children }: { children: React.ReactNode }) |
226 | 99 | <PublicEnvScript /> |
227 | 100 |
|
228 | 101 | {/* RB2B Script - Only load on hosted version */} |
229 | | - {/* {isHosted && env.NEXT_PUBLIC_RB2B_KEY && ( |
| 102 | + {isHosted && env.NEXT_PUBLIC_RB2B_KEY && ( |
230 | 103 | <script |
231 | 104 | dangerouslySetInnerHTML={{ |
232 | 105 | __html: `!function () {var reb2b = window.reb2b = window.reb2b || [];if (reb2b.invoked) return;reb2b.invoked = true;reb2b.methods = ["identify", "collect"];reb2b.factory = function (method) {return function () {var args = Array.prototype.slice.call(arguments);args.unshift(method);reb2b.push(args);return reb2b;};};for (var i = 0; i < reb2b.methods.length; i++) {var key = reb2b.methods[i];reb2b[key] = reb2b.factory(key);}reb2b.load = function (key) {var script = document.createElement("script");script.type = "text/javascript";script.async = true;script.src = "https://b2bjsstore.s3.us-west-2.amazonaws.com/b/" + key + "/${env.NEXT_PUBLIC_RB2B_KEY}.js.gz";var first = document.getElementsByTagName("script")[0];first.parentNode.insertBefore(script, first);};reb2b.SNIPPET_VERSION = "1.0.1";reb2b.load("${env.NEXT_PUBLIC_RB2B_KEY}");}();`, |
233 | 106 | }} |
234 | 107 | /> |
235 | | - )} */} |
| 108 | + )} |
236 | 109 | </head> |
237 | 110 | <body suppressHydrationWarning> |
238 | | - <ZoomPrevention /> |
239 | | - <TelemetryConsentDialog /> |
240 | | - {children} |
241 | | - {isHosted && ( |
242 | | - <> |
243 | | - <SpeedInsights /> |
244 | | - <Analytics /> |
245 | | - </> |
246 | | - )} |
| 111 | + <BrandedLayout> |
| 112 | + <ZoomPrevention /> |
| 113 | + <TelemetryConsentDialog /> |
| 114 | + {children} |
| 115 | + {isHosted && ( |
| 116 | + <> |
| 117 | + <SpeedInsights /> |
| 118 | + <Analytics /> |
| 119 | + </> |
| 120 | + )} |
| 121 | + </BrandedLayout> |
247 | 122 | </body> |
248 | 123 | </html> |
249 | 124 | ) |
|
0 commit comments