diff --git a/next.config.ts b/next.config.ts index ec2f55f6..bd6a04dc 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,18 +1,96 @@ /* eslint-disable @typescript-eslint/no-require-imports */ import type { NextConfig } from "next"; -const createMDX = require('@next/mdx'); +const createMDX = require('@next/mdx'); const nextConfig: NextConfig = { - /* config options here */ pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], - - + experimental: { + optimizePackageImports: ["@vercel/analytics"], + }, + async headers() { + return [ + { + source: "/(.*)", + headers: [ + { + key: "X-Content-Type-Options", + value: "nosniff", + }, + { + key: "X-Frame-Options", + value: "DENY", + }, + { + key: "X-XSS-Protection", + value: "1; mode=block", + }, + { + key: "Referrer-Policy", + value: "strict-origin-when-cross-origin", + }, + { + key: "Permissions-Policy", + value: "camera=(), microphone=(), geolocation=()", + }, + ], + }, + { + source: "/docs/(.*)", + headers: [ + { + key: "Cache-Control", + value: "public, max-age=3600, stale-while-revalidate=86400", + }, + ], + }, + { + source: "/sitemap.xml", + headers: [ + { + key: "Cache-Control", + value: "public, max-age=3600, stale-while-revalidate=86400", + }, + ], + }, + { + source: "/robots.txt", + headers: [ + { + key: "Cache-Control", + value: "public, max-age=3600, stale-while-revalidate=86400", + }, + ], + }, + ]; + }, + async redirects() { + return [ + { + source: "/documentation", + destination: "/docs", + permanent: true, + }, + { + source: "/guide", + destination: "/docs", + permanent: true, + }, + ]; + }, + images: { + formats: ["image/webp", "image/avif"], + deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], + imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], + }, + compress: true, + poweredByHeader: false, + generateEtags: true, }; const withMDX = createMDX({ // Add markdown plugins here, as desired }) - + // Merge MDX config with Next.js config export default withMDX(nextConfig) diff --git a/public/browserconfig.xml b/public/browserconfig.xml new file mode 100644 index 00000000..ceb1d86b --- /dev/null +++ b/public/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #0E201B + + + diff --git a/src/app/docs/layout.tsx b/src/app/docs/layout.tsx index bc6a42c6..335e5330 100644 --- a/src/app/docs/layout.tsx +++ b/src/app/docs/layout.tsx @@ -1,14 +1,94 @@ import { SideBar } from "@/components/(home)/sideBar"; import { dm_sans } from "@/font/google"; +import type { Metadata } from "next"; +import Script from "next/script"; + +const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || "http://localhost:3000"; + +export const metadata: Metadata = { + title: "Documentation", + description: "Complete documentation for Nexy framework - Learn how to build modern web applications with Python and FastAPI.", + keywords: [ + "Nexy documentation", + "Python framework docs", + "FastAPI documentation", + "Web development guide", + "API development tutorial", + ], + openGraph: { + title: "Nexy Documentation", + description: "Complete documentation for Nexy framework - Learn how to build modern web applications with Python and FastAPI.", + type: "website", + url: `${siteUrl}/docs`, + }, + twitter: { + title: "Nexy Documentation", + description: "Complete documentation for Nexy framework - Learn how to build modern web applications with Python and FastAPI.", + }, + alternates: { + canonical: `${siteUrl}/docs`, + }, +}; const DocsLayout = ({ children }: { children: React.ReactNode }) => { return ( -