Skip to content

Commit

Permalink
🌐 layout optimized for seo
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanptm committed Oct 11, 2024
1 parent 7d6bf0d commit 0a43daf
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 104 deletions.
16 changes: 3 additions & 13 deletions client/app/admin/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
import { ReactNode, FC } from "react";
import { Metadata } from "next";
import Layout from "@/components/layout/AdminLayout";
import { metadata as rootMeta } from '@/app/layout';

interface AdminLayoutWrapperProps {
children: ReactNode;
signin: ReactNode;
}

export const metadata: Metadata = {
...rootMeta,
title: {
template: "%s | Admin",
default: "Admin Dashboard - Manage Hospital Operations | AVM Ayurvedic",
},
description: "Admin Dashboard for managing AVM Ayurvedic Hospital operations, including doctor management, patient management, and appointment tracking.",
keywords: [
"admin dashboard",
"hospital management",
"AVM Ayurvedic admin",
"appointment tracking",
"manage doctors",
"manage patients",
"Ayurveda hospital",
"admin portal",
"hospital operations"
],
}
};

const AdminLayoutWrapper: FC<AdminLayoutWrapperProps> = ({ children, signin }) => {
Expand Down
14 changes: 3 additions & 11 deletions client/app/doctor/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
import { ReactNode, FC } from "react";
import { Metadata } from "next";
import Layout from "@/components/layout/DoctorLayout";
import { metadata as rootMeta } from '@/app/layout';


interface AdminLayoutWrapperProps {
children: ReactNode;
auth: ReactNode;
}

export const metadata: Metadata = {
...rootMeta,
title: {
template: "%s | Doctor Dashboard | AVM Ayurvedic",
default: "Doctor Dashboard - Manage Appointments and Consultations | AVM Ayurvedic",
},
description: "Access and manage your appointments, video consultations, and patient records efficiently through the Doctor Dashboard at AVM Ayurvedic Hospital.",
keywords: [
"doctor dashboard",
"AVM Ayurvedic doctor portal",
"manage appointments",
"patient consultations",
"video consultations",
"Ayurveda hospital",
"doctor appointment management",
"healthcare dashboard"
]
};
const AdminLayoutWrapper: FC<AdminLayoutWrapperProps> = ({ children, auth }) => {
return <Layout auth={auth}>{children}</Layout>;
Expand Down
17 changes: 0 additions & 17 deletions client/app/doctor/page.tsx

This file was deleted.

115 changes: 72 additions & 43 deletions client/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,78 @@ const inter = Plus_Jakarta_Sans({
variable: "--font-sans",
});

export const metadata: Metadata = {
metadataBase: new URL('https://avm-ayurvedic.online'),
title: {
template: '%s | AVM Ayurvedic',
default: 'AVM Ayurvedic - Holistic Ayurveda Health Care & Wellness',
},
description: 'Experience authentic Ayurvedic treatments at AVM Ayurvedic Hospital. Book online appointments, access video consultations, and embrace holistic healing for a balanced life.',
openGraph: {
title: 'AVM Ayurvedic - Holistic Ayurveda Health & Wellness',
description: 'Discover personalized Ayurvedic care with AVM Ayurvedic. Book consultations and experience the benefits of natural healing.',
type: 'website',
url: '/',
siteName: 'AVM Ayurvedic',
locale: 'en_US',
images: [
{
url: '/og-image.webp',
width: 1200,
height: 630,
alt: 'AVM Ayurvedic - Holistic Ayurveda Health Care',
},
],
},
twitter: {
card: 'summary_large_image',
title: 'AVM Ayurvedic - Holistic Health & Wellness',
description: 'Book Ayurvedic treatments & consultations online. Embrace natural healing and wellness through authentic Ayurveda.',
images: ['/og-image.webp'],
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
'max-video-preview': -1,
'max-image-preview': 'large',
'max-snippet': -1,
},
},
keywords: [
'AVM Ayurvedic',
'Ayurvedic hospital',
'Ayurvedic treatments',
'holistic healing',
'online Ayurveda consultation',
'natural medicine',
'herbal remedies',
'wellness center',
'Ayurvedic doctors online',
'Ayurvedic health care',
'mental wellness',
'immune support',
'Ayurvedic lifestyle',
'natural therapies',
'online appointments',
'virtual consultations',
'herbal medicine',
'AI Ayurvedic assistant',
'wellness tips',
'video consultations',
],
alternates: {
canonical: '/',
},
icons: {
icon: '/favicon.ico',
apple: '/favicon.ico',
},
category: 'health',
}

export default function RootLayout({
children,
chatbot
Expand All @@ -43,46 +115,3 @@ export default function RootLayout({
</html>
);
}

export const metadata: Metadata = {
title: {
template: "%s | AVM Ayurvedic",
default: "AVM Ayurvedic - Holistic Ayurveda Health Care",
},
description: "Experience natural healing with AVM Ayurvedic Hospital. Book appointments, video call consultations, and explore the benefits of authentic Ayurvedic treatments.",
keywords: [
"AVM Ayurvedic",
"Ayurveda hospital",
"Ayurvedic treatments",
"natural healing",
"Ayurveda appointments",
"Ayurveda video consultations",
"herbal medicine",
"holistic healthcare",
"Ayurvedic ai assistant",
"Ayurveda",
"Holistic Health",
"Natural Healing",
"Ayurvedic Center",
"Ayurvedic Doctors",
"Herbal Medicine",
"Online Consultation",
"Video Consultation",
"Wellness",
"Natural Remedies",
"Ayurvedic Treatments",
"Health Tips",
"Ayurvedic assistant",
"Real time chat"
],
openGraph: {
title: "AVM Ayurvedic - Holistic Ayurveda Health Care",
description: "Join us for holistic Ayurveda treatments and consultations, bringing you closer to natural wellness and healing.",
type: "website",
// url: "https://www.avmayurvedic.com",
},
robots: {
index: true,
follow: true,
},
};
23 changes: 4 additions & 19 deletions client/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,16 @@ import ImageSlider from "@/components/page-components/landing/home/ImageSlider";
import WhyUs from "@/components/page-components/landing/home/WhyUs";
import { Metadata } from "next";
import FeaturedTreatments from "@/components/page-components/landing/home/FeaturedTreatment";
import FAQSection from "@/components/page-components/landing/clinicians/FAQSection";
import FAQSection from "@/components/page-components/landing/clinicians/FAQSection";
import LifestyleTips from "@/components/page-components/landing/home/LifeStyleTips";
import AyurvedicHerbs from "@/components/page-components/landing/home/Herbs";
import { memo } from "react";
import OurGoals from "@/components/page-components/landing/home/OurGoals";
import { metadata as rootMeta } from './layout';

export const metadata: Metadata = {
keywords: [
"Ayurveda",
"Holistic Health",
"Natural Healing",
"Ayurvedic Center",
"Ayurvedic Doctors",
"Herbal Medicine",
"Online Consultation",
"Video Consultation",
"Wellness",
"Natural Remedies",
"Ayurvedic Treatments",
"Health Tips",
"Ayurvedic assistant",
"Real time chat"
],
description: "Discover holistic healing through Ayurveda. Book appointments with expert Ayurvedic doctors for online and video consultations. Learn about herbal treatments, wellness tips, and personalized care at our Ayurvedic center."
}
...rootMeta
};


const HomePage = () => {
Expand Down
2 changes: 1 addition & 1 deletion client/components/layout/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const NavBar = () => {
} catch (error) {
console.log(error);
}
}, [logoutFunc, redirect, setCredentials, toast, logout]);
}, [logoutFunc, redirect, setCredentials, toast, logout, toast]);

const handleLinkHome = useCallback(() => {
setIsSheetOpen(false);
Expand Down
72 changes: 72 additions & 0 deletions client/lib/utils/image-generator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@

'use client'
import React, { useEffect, useRef } from 'react'
import { Card } from "@/components/ui/card"
import { Button } from "@/components/ui/button"

export default function OgImage() {
const canvasRef = useRef<HTMLCanvasElement>(null)

useEffect(() => {
const canvas = canvasRef.current
if (!canvas) return

const ctx = canvas.getContext('2d')
if (!ctx) return

// Set canvas size to 1200x630 (standard og-image size)
canvas.width = 1200
canvas.height = 630

// Load and draw the background image
const img = new Image()
img.onload = () => {
// Draw the image covering the entire canvas
ctx.drawImage(img, 0, 0, canvas.width, canvas.height)

// Add a semi-transparent overlay
ctx.fillStyle = 'rgba(0, 0, 0, 0.5)'
ctx.fillRect(0, 0, canvas.width, canvas.height)

// Add title
ctx.font = 'bold 64px Arial'
ctx.fillStyle = '#ffffff'
ctx.textAlign = 'center'
ctx.fillText('AVM Ayurvedic', canvas.width / 2, 200)

// Add subtitle
ctx.font = '32px Arial'
ctx.fillStyle = '#f0f0f0'
ctx.fillText('Holistic Ayurveda Health Care & Wellness', canvas.width / 2, 260)

// Add call-to-action
ctx.font = 'bold 36px Arial'
ctx.fillStyle = '#4CAF50'
ctx.fillText('Book Your Consultation Today', canvas.width / 2, 540)
}
img.src = '/assets/images/onboarding-img.png'
}, [])

const downloadImage = () => {
const canvas = canvasRef.current
if (!canvas) return

const link = document.createElement('a')
link.download = 'og-image.webp'
link.href = canvas.toDataURL('image/webp')
link.click()
}

return (
<Card className="p-6 max-w-3xl mx-auto">
<h2 className="text-2xl font-bold mb-4">AVM Ayurvedic OG Image Preview</h2>
<div className="mb-4">
<canvas ref={canvasRef} style={{ width: '100%', height: 'auto', maxWidth: '600px' }} />
</div>
<Button onClick={downloadImage}>Download OG Image</Button>
<p className="mt-4 text-sm text-gray-600">
This image will be used as the og:image for your website. It will appear when your site is shared on social media platforms.
</p>
</Card>
)
}
Binary file added client/public/og-image.webp
Binary file not shown.

0 comments on commit 0a43daf

Please sign in to comment.