fix: Put meta and links in root

This commit is contained in:
Sahaj Jain
2025-04-12 22:29:38 +05:30
parent d3afc78d5f
commit b66b4c1ad6
2 changed files with 82 additions and 82 deletions
-82
View File
@@ -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);
+82
View File
@@ -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