diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx index ece8c43..a5571c1 100644 --- a/app/blog/[slug]/page.tsx +++ b/app/blog/[slug]/page.tsx @@ -1,15 +1,26 @@ import { notFound } from "next/navigation"; import type { Metadata } from "next"; +import dynamic from "next/dynamic"; import { getBlogPostBySlug, getAllBlogPosts as getAllPosts, type BlogPost, } from "../../../lib/content"; import ContentBanner from "../../components/ContentBanner"; -import RelatedArticles from "../../components/RelatedArticles"; import AskOrganizer from "../../components/AskOrganizer"; import { getAssetPath, ASSETS } from "../../../lib/assetUtils"; +// Code split RelatedArticles - blog-specific, below the fold +const RelatedArticles = dynamic( + () => import("../../components/RelatedArticles"), + { + loading: () => ( +
+ ), + ssr: true, + }, +); + // AskOrganizer data - same as index page const askOrganizerData = { title: "Still have questions?", diff --git a/app/layout.tsx b/app/layout.tsx index f989716..c402578 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,10 +1,18 @@ import { Inter, Bricolage_Grotesque, Space_Grotesk } from "next/font/google"; import type { Metadata } from "next"; import type { ReactNode } from "react"; +import dynamic from "next/dynamic"; import "./globals.css"; -import Footer from "./components/Footer"; import ConditionalHeader from "./components/ConditionalHeader"; +// Code split Footer - below the fold, can be lazy loaded +const Footer = dynamic(() => import("./components/Footer"), { + loading: () => ( +