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.
## 2024-06-11 - Nested main tags invalid
**Learning:** HTML5 specifications mandate that there must not be more than one `<main>` element in a document that does not have the hidden attribute. In `actualites/[slug]/page.tsx`, an outer layout tag and an inner grid content tag both used `<main>`.
**Action:** When working on complex page layouts (especially those with sidebars), verify that only the primary outermost wrapper for the main content block uses the `<main>` element. Inner wrappers for layout control should be converted to `<div>`.
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: Replaced inner <main> with <div> to prevent invalid nested <main> elements, 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