- Add metadataBase to root layout so OG/Twitter/canonical URLs resolve to absolute https URLs (fixes broken social previews) - New src/lib/seo.ts with SITE_URL + JSON-LD builders - New robots.ts (disallow api/admin/private app paths) and sitemap.ts (marketing pages + blog posts with real lastmod dates) - JSON-LD: Organization/WebSite/SoftwareApplication on home, Blog+Breadcrumb on blog list, BlogPosting+Breadcrumb on posts - Per-page canonical + Open Graph on all marketing pages; article OG + Twitter cards on blog posts; per-post dynamic OG image - noindex on (app) and admin layouts; richer PWA manifest - Fix CSP to allow plausible.io in script-src/connect-src (analytics was silently blocked) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import type { NextConfig } from "next";
|
|
import withSerwistInit from "@serwist/next";
|
|
|
|
const withSerwist = withSerwistInit({
|
|
swSrc: "src/app/sw.ts",
|
|
swDest: "public/sw.js",
|
|
// Disable in dev so it never interferes with HMR / hot reload
|
|
disable: process.env.NODE_ENV === "development",
|
|
});
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/(.*)",
|
|
headers: [
|
|
{ key: "X-Frame-Options", value: "DENY" },
|
|
{ key: "X-Content-Type-Options", value: "nosniff" },
|
|
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
|
|
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
|
|
{ key: "Strict-Transport-Security", value: "max-age=31536000; includeSubDomains" },
|
|
{ key: "Content-Security-Policy", value:
|
|
"default-src 'self'; " +
|
|
"img-src 'self' data: https://*.r2.cloudflarestorage.com https://*.r2.dev; " +
|
|
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://plausible.io; " +
|
|
"style-src 'self' 'unsafe-inline'; " +
|
|
"connect-src 'self' https://llm.manohargupta.com https://plausible.io; " +
|
|
"font-src 'self' data:;"
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withSerwist(nextConfig);
|