Add code splitting

This commit is contained in:
adilallo
2026-01-26 13:05:13 -07:00
parent 86d7cff5d4
commit 0dec7c41ee
3 changed files with 58 additions and 7 deletions
+12 -1
View File
@@ -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: () => (
<section className="py-[var(--spacing-scale-032)] min-h-[400px]" />
),
ssr: true,
},
);
// AskOrganizer data - same as index page
const askOrganizerData = {
title: "Still have questions?",