--- import type { Page } from '@/types'; import { siteConfig } from '@/config'; import { render } from 'astro:content'; import { generatePageSEO } from '@/utils/seo'; import { optimizeContentImagePath, getOptimizedFormat } from '@/utils/images'; import BaseLayout from '@/layouts/BaseLayout.astro'; import TableOfContents from '@/components/TableOfContents.astro'; import Lightbox from '@/components/Lightbox.astro'; import ImageWrapper from '@/components/ImageWrapper.astro'; export interface Props { page: Page; } const { page } = Astro.props; // No need for dynamic image import - ImageWrapper handles this // Render the page content const { Content, headings } = await render(page); // Generate SEO data const seoData = generatePageSEO(page, Astro.url.href); // Generate table of contents from headings using configurable depth const maxDepth = siteConfig.tableOfContents.depth; const toc = headings.filter(h => h.depth >= 2 && h.depth <= maxDepth); // Check if TOC should be shown - global setting, then hideTOC frontmatter, then showTOC frontmatter (default true for pages) const hideTOC = page.data.hideTOC === true; const showTOC = page.data.showTOC !== undefined ? page.data.showTOC : true; const shouldShowTOC = siteConfig.tableOfContents.enabled && !hideTOC && showTOC && toc.length > 0; // Generate structured data const structuredData = { '@context': 'https://schema.org', '@type': 'WebPage', name: page.data.title, description: page.data.description, url: Astro.url.href, isPartOf: { '@type': 'WebSite', name: siteConfig.title, url: siteConfig.site }, author: { '@type': 'Person', name: siteConfig.author } }; ---