SEO Improvements.
This commit is contained in:
@ -17,7 +17,6 @@
|
||||
"@unpic/react": "^1.0.2",
|
||||
"@vitejs/plugin-react": "^6.0.1",
|
||||
"framer-motion": "^12.23.9",
|
||||
"lucide-react": "^0.525.0",
|
||||
"nitro": "^3.0.260415-beta",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
|
||||
@ -18,7 +18,7 @@ export const Route = createRootRoute({
|
||||
// OpenGraph
|
||||
{ property: "og:title", content: "Mozimo - Premium Artisanal Chocolate" },
|
||||
{ property: "og:description", content: "India's Premier European Style Bean to Bar Chocolate Experience" },
|
||||
{ property: "og:url", content: "https://mozimo.com" },
|
||||
{ property: "og:url", content: "https://mozimo.in" },
|
||||
{ property: "og:site_name", content: "Mozimo Chocolate" },
|
||||
{ property: "og:image", content: "/og-image.jpg" },
|
||||
{ property: "og:locale", content: "en_US" },
|
||||
@ -43,13 +43,38 @@ export const Route = createRootRoute({
|
||||
|
||||
// Preload critical images
|
||||
{ rel: 'preload', as: 'image', href: '/banners/slider-1.jpg' },
|
||||
{ rel: 'preload', as: 'image', href: '/logo/logo.svg' },
|
||||
{ rel: 'preload', as: 'image', href: '/bst/bs1.svg' },
|
||||
|
||||
// DNS prefetch
|
||||
{ rel: 'dns-prefetch', href: '//fonts.googleapis.com' },
|
||||
{ rel: 'dns-prefetch', href: '//fonts.gstatic.com' },
|
||||
],
|
||||
scripts: [
|
||||
{
|
||||
src: "https://www.googletagmanager.com/gtag/js?id=AW-16664307519",
|
||||
async: true,
|
||||
},
|
||||
{
|
||||
children: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'AW-16664307519');
|
||||
`,
|
||||
},
|
||||
{
|
||||
type: 'application/ld+json',
|
||||
children: JSON.stringify({
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Organization",
|
||||
"name": "Mozimo Chocolate",
|
||||
"url": "https://mozimo.in",
|
||||
"logo": "https://mozimo.in/logo/logo.svg",
|
||||
"sameAs": [
|
||||
"https://www.instagram.com/mozimo_chocolate/"
|
||||
]
|
||||
})
|
||||
}
|
||||
]
|
||||
}),
|
||||
component: RootLayout,
|
||||
notFoundComponent: () => {
|
||||
@ -67,9 +92,6 @@ function RootLayout() {
|
||||
<head>
|
||||
<HeadContent />
|
||||
</head>
|
||||
{/* We apply a generic font-sans class or remove Next.js specific font variables.
|
||||
Since the Inter Google Font is loaded via the stylesheet above, it will automatically apply
|
||||
if configured in Tailwind CSS. */}
|
||||
<body>
|
||||
<LazyMotion features={loadFeatures} strict>
|
||||
<Outlet />
|
||||
|
||||
@ -8,6 +8,15 @@ import { lazy, Suspense } from "react";
|
||||
const Footer = lazy(() => import("@/components/Footer"));
|
||||
export const Route = createFileRoute('/about')({
|
||||
component: AboutPage,
|
||||
head: () => ({
|
||||
meta: [
|
||||
{ title: "About Us - Mozimo Chocolate" },
|
||||
{ name: "description", content: "Discover the passionate pursuit of crafting exceptional chocolate at Mozimo. We champion cocoa diversity and sustainability." }
|
||||
],
|
||||
links: [
|
||||
{ rel: "canonical", href: "https://mozimo.in/about" }
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
// Premium animation variants
|
||||
|
||||
@ -3,6 +3,10 @@ import { createFileRoute } from '@tanstack/react-router';
|
||||
// Instagram Basic Display API configuration
|
||||
const INSTAGRAM_ACCESS_TOKEN = process.env.INSTAGRAM_ACCESS_TOKEN || 'IGQWRQSUY4b3RQWU9ZARHlVVUFDaWxJZAWFOUVllM0NxMk1zSHJ5X2JGc2dpRUxyTjBaeDNhUm0yaFZAQeUotVU9VUmFEQkJxU25CdFp3bURSZAGtnLXhCZAHVId21SWUNiNjVzc0pjZAlhPNDRxTDFzZAEQ0ZAXoyVlpUaHcZD';
|
||||
|
||||
let cachedPosts: any = null;
|
||||
let cacheTimestamp = 0;
|
||||
const CACHE_DURATION = 30 * 60 * 1000; // 30 minutes
|
||||
|
||||
interface InstagramPostData {
|
||||
id: string;
|
||||
caption?: string;
|
||||
@ -25,33 +29,10 @@ export const Route = createFileRoute('/api/instagram')({
|
||||
);
|
||||
}
|
||||
|
||||
// First, get the user ID using the access token
|
||||
const userResponse = await fetch(
|
||||
`https://graph.instagram.com/me?fields=id,username&access_token=${INSTAGRAM_ACCESS_TOKEN}`
|
||||
);
|
||||
|
||||
if (!userResponse.ok) {
|
||||
const errorText = await userResponse.text();
|
||||
console.error('Failed to fetch user info:', errorText);
|
||||
|
||||
// Check if token is expired
|
||||
if (errorText.includes('Session has expired') || errorText.includes('code":190')) {
|
||||
return Response.json(
|
||||
{
|
||||
error: 'Instagram access token has expired',
|
||||
details: 'The access token needs to be refreshed. Please generate a new token from Instagram Developer Console.',
|
||||
code: 'TOKEN_EXPIRED'
|
||||
},
|
||||
{ status: 401 }
|
||||
);
|
||||
if (cachedPosts && Date.now() - cacheTimestamp < CACHE_DURATION) {
|
||||
return Response.json({ posts: cachedPosts });
|
||||
}
|
||||
|
||||
throw new Error('Failed to authenticate with Instagram');
|
||||
}
|
||||
|
||||
const userData = await userResponse.json();
|
||||
console.log('Instagram user data:', userData);
|
||||
|
||||
// Fetch user's media (posts)
|
||||
const mediaResponse = await fetch(
|
||||
`https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,thumbnail_url,permalink,timestamp&access_token=${INSTAGRAM_ACCESS_TOKEN}&limit=6`
|
||||
@ -89,6 +70,9 @@ export const Route = createFileRoute('/api/instagram')({
|
||||
timestamp: post.timestamp
|
||||
}));
|
||||
|
||||
cachedPosts = posts;
|
||||
cacheTimestamp = Date.now();
|
||||
|
||||
return Response.json({ posts });
|
||||
} catch (error) {
|
||||
console.error('Instagram API Error:', error);
|
||||
|
||||
@ -12,6 +12,11 @@ const Footer = lazy(() => import("@/components/Footer"));
|
||||
|
||||
export const Route = createFileRoute('/')({
|
||||
component: Home,
|
||||
head: () => ({
|
||||
links: [
|
||||
{ rel: "canonical", href: "https://mozimo.in/" }
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
// Premium animation variants
|
||||
|
||||
@ -2815,11 +2815,6 @@ lru-cache@^5.1.1:
|
||||
dependencies:
|
||||
yallist "^3.0.2"
|
||||
|
||||
lucide-react@^0.525.0:
|
||||
version "0.525.0"
|
||||
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.525.0.tgz#5f7bcecd65e4f9b2b5b6b5d295e3376df032d5e3"
|
||||
integrity sha512-Tm1txJ2OkymCGkvwoHt33Y2JpN5xucVq1slHcgE6Lk0WjDfjgKWor5CdVER8U6DvcfMwh4M8XxmpTiyzfmfDYQ==
|
||||
|
||||
magic-string@^0.30.21:
|
||||
version "0.30.21"
|
||||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.21.tgz#56763ec09a0fa8091df27879fd94d19078c00d91"
|
||||
|
||||
Reference in New Issue
Block a user