docs: add favicon, reorganize docs and add customization guide
- Add icon.png as default favicon (cropped to remove transparent padding) - Fix layout.tsx to use icon.png as fallback when favicon_url is not set in DB - Move ADMIN_GUIDE.md to docs/ folder - Add docs/CUSTOMIZATION.md with guide on how to customize icon, title, footer
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 658 KiB |
+20
-10
@@ -1,20 +1,30 @@
|
||||
import type { Metadata } from 'next'
|
||||
import './globals.css'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { Footer } from '@/components/storefront/Footer'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'ShopX - E-Commerce Platform',
|
||||
description: 'Your online store',
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
try {
|
||||
const rows = await prisma.siteSettings.findMany({
|
||||
where: { key: { in: ['site_name', 'site_description', 'favicon_url'] } },
|
||||
})
|
||||
const s = Object.fromEntries(rows.map((r) => [r.key, r.value]))
|
||||
return {
|
||||
title: (s.site_name as string) || 'ShopX',
|
||||
description: (s.site_description as string) || 'Your online store',
|
||||
icons: { icon: (s.favicon_url as string) || '/icon.png' },
|
||||
}
|
||||
} catch {
|
||||
return { title: 'ShopX', description: 'Your online store' }
|
||||
}
|
||||
}
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className="bg-gray-50 text-gray-900 min-h-screen">
|
||||
<html lang="it">
|
||||
<body className="bg-gray-50 text-gray-900 min-h-screen flex flex-col">
|
||||
{children}
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user