From b66b4c1ad6724b14c60c3f418bb72d15b8bb10ee Mon Sep 17 00:00:00 2001 From: Sahaj Jain Date: Sat, 12 Apr 2025 22:29:38 +0530 Subject: [PATCH] fix: Put meta and links in root --- src/pages/home.tsx | 82 ---------------------------------------------- src/root.tsx | 82 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/src/pages/home.tsx b/src/pages/home.tsx index 0660ba1d..77849384 100644 --- a/src/pages/home.tsx +++ b/src/pages/home.tsx @@ -9,88 +9,6 @@ import { FAQ } from "@/components/home/faq"; import { CTA } from "@/components/home/cta"; import { Footer } from "@/components/home/footer"; -export function meta() { - const siteName = "tweakcn"; - const siteUrl = "https://tweakcn.com/"; - const ogImage = "https://tweakcn.com/og-image.png"; - const title = - "Beautiful themes for shadcn/ui — tweakcn | Theme Editor & Generator"; - const description = - "Customize theme for shadcn/ui with tweakcn's interactive editor. Supports Tailwind CSS v4, Shadcn UI, and custom styles. Modify properties, preview changes, and get the code in real time."; - - return [ - { title }, - { name: "description", content: description }, - { - name: "keywords", - content: - "theme editor, theme generator, shadcn, ui, components, react, tailwind, button, editor, visual editor, component editor, web development, frontend, design system, UI components, React components, Tailwind CSS, shadcn/ui themes", - }, - { name: "author", content: "Sahaj Jain" }, - { name: "image", content: ogImage }, - { name: "url", content: siteUrl }, - { name: "twitter:card", content: "summary_large_image" }, - { name: "twitter:url", content: siteUrl }, - { name: "twitter:title", content: title }, - { name: "twitter:description", content: description }, - { name: "twitter:image", content: ogImage }, - { name: "robots", content: "index, follow" }, - { name: "language", content: "English" }, - { name: "revisit-after", content: "7 days" }, - { name: "generator", content: "Vite" }, - { name: "charset", content: "UTF-8" }, - { name: "viewport", content: "width=device-width, initial-scale=1.0" }, - { property: "og:type", content: "website" }, - { property: "og:url", content: siteUrl }, - { property: "og:title", content: title }, - { property: "og:description", content: description }, - { property: "og:image", content: ogImage }, - { property: "og:site_name", content: siteName }, - ]; -} - -export function links() { - return [ - { - rel: "canonical", - href: "https://tweakcn.com/", - }, - { - rel: "apple-touch-icon", - href: "/apple-touch-icon.png", - }, - { - rel: "icon", - type: "image/png", - sizes: "32x32", - href: "/favicon-32x32.png", - }, - { - rel: "icon", - type: "image/png", - sizes: "16x16", - href: "/favicon-16x16.png", - }, - { - rel: "manifest", - href: "/site.webmanifest", - }, - { - rel: "preconnect", - href: "https://fonts.googleapis.com", - }, - { - rel: "preconnect", - href: "https://fonts.gstatic.com", - crossOrigin: "anonymous", - }, - { - rel: "stylesheet", - href: "https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Fira+Code:wght@300..700&family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400..700;1,400..700&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Outfit:wght@100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100..900;1,100..900&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&family=Space+Grotesk:wght@300..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap", - }, - ]; -} - export default function Component() { const [isScrolled, setIsScrolled] = useState(false); const [mobileMenuOpen, setMobileMenuOpen] = useState(false); diff --git a/src/root.tsx b/src/root.tsx index 60cfd28c..a252e0d5 100644 --- a/src/root.tsx +++ b/src/root.tsx @@ -4,6 +4,88 @@ import posthog from "posthog-js"; import { useEffect } from "react"; import themeInitScriptContent from "/public/scripts/theme-init.js?raw"; +export function meta() { + const siteName = "tweakcn"; + const siteUrl = "https://tweakcn.com/"; + const ogImage = "https://tweakcn.com/og-image.png"; + const title = + "Beautiful themes for shadcn/ui — tweakcn | Theme Editor & Generator"; + const description = + "Customize theme for shadcn/ui with tweakcn's interactive editor. Supports Tailwind CSS v4, Shadcn UI, and custom styles. Modify properties, preview changes, and get the code in real time."; + + return [ + { title }, + { name: "description", content: description }, + { + name: "keywords", + content: + "theme editor, theme generator, shadcn, ui, components, react, tailwind, button, editor, visual editor, component editor, web development, frontend, design system, UI components, React components, Tailwind CSS, shadcn/ui themes", + }, + { name: "author", content: "Sahaj Jain" }, + { name: "image", content: ogImage }, + { name: "url", content: siteUrl }, + { name: "twitter:card", content: "summary_large_image" }, + { name: "twitter:url", content: siteUrl }, + { name: "twitter:title", content: title }, + { name: "twitter:description", content: description }, + { name: "twitter:image", content: ogImage }, + { name: "robots", content: "index, follow" }, + { name: "language", content: "English" }, + { name: "revisit-after", content: "7 days" }, + { name: "generator", content: "Vite" }, + { name: "charset", content: "UTF-8" }, + { name: "viewport", content: "width=device-width, initial-scale=1.0" }, + { property: "og:type", content: "website" }, + { property: "og:url", content: siteUrl }, + { property: "og:title", content: title }, + { property: "og:description", content: description }, + { property: "og:image", content: ogImage }, + { property: "og:site_name", content: siteName }, + ]; +} + +export function links() { + return [ + { + rel: "canonical", + href: "https://tweakcn.com/", + }, + { + rel: "apple-touch-icon", + href: "/apple-touch-icon.png", + }, + { + rel: "icon", + type: "image/png", + sizes: "32x32", + href: "/favicon-32x32.png", + }, + { + rel: "icon", + type: "image/png", + sizes: "16x16", + href: "/favicon-16x16.png", + }, + { + rel: "manifest", + href: "/site.webmanifest", + }, + { + rel: "preconnect", + href: "https://fonts.googleapis.com", + }, + { + rel: "preconnect", + href: "https://fonts.gstatic.com", + crossOrigin: "anonymous", + }, + { + rel: "stylesheet", + href: "https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Fira+Code:wght@300..700&family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400..700;1,400..700&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Outfit:wght@100..900&family=Oxanium:wght@200..800&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100..900;1,100..900&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&family=Space+Grotesk:wght@300..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap", + }, + ]; +} + function PosthogInit() { useEffect(() => { // Ensure PostHog key exists before initializing