Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/spider.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
## 2024-05-19 - Typechecking JSON-LD Date Properties
**Learning:** When passing potentially null date fields (like `publishedAt`, `updatedAt`) from Payload CMS to jsonLd generator functions, using the fields directly can cause strict TypeScript compilation failures since the schemas explicitly expect `string | undefined` and not `null`.
**Action:** Always use the logical OR operator with `undefined` (e.g., `datePublished: post.publishedAt || undefined`) when passing date properties to JSON-LD generator functions to satisfy strict type requirements and prevent build regressions.
## 2026-06-22 - Nested Main Tags in Page Layouts
**Learning:** Detailed page layouts (like `actualites/[slug]/page.tsx`) often define `<main>` as their outermost wrapper. If inner column structures also use `<main>`, it results in invalid HTML5 (nested `<main>` tags). This negatively impacts semantic structure and crawler readability.
**Action:** When working on page components, always verify the outermost wrapper tag before using `<main>` for inner content areas. Use semantic `<div>` elements for structural grid/column wrappers if a `<main>` or `<article>` wrapper already exists at a higher level.
5 changes: 3 additions & 2 deletions src/app/(frontend)/[locale]/actualites/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export default async function Actualite({ params: paramsPromise }: Args) {
</aside>

{/* CENTER COLUMN: Main Article (Left aligned flow) */}
<main className="col-span-1 lg:col-span-7">
{/* SEO: Changed <main> to <div> to prevent invalid nested <main> tags, improving semantic structure and crawlability. */}
<div className="col-span-1 lg:col-span-7">
<article className="w-full">

{/* Hero Image */}
Expand Down Expand Up @@ -254,7 +255,7 @@ export default async function Actualite({ params: paramsPromise }: Args) {
</div>

</article>
</main>
</div>

{/* RIGHT COLUMN: Related / Latest News */}
<aside className="hidden lg:block lg:col-span-3">
Expand Down