p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

TutorialLayout crashes rendering tutorials without optional featuredImage and authors fields

Open hxrshxz opened this issue 2 months ago • 2 comments

Most appropriate sections of the p5.js website?

Tutorials

What is your operating system?

Linux

Web browser and version

No response

Actual Behavior

When rendering a tutorial that doesn't include the optional featuredImage or authors fields in its frontmatter, the site crashes with:

Image

The component tries to access .src and .join() on undefined properties without checking if they exist first.

Expected Behavior

Tutorials without optional featuredImage or authors fields should render without errors. The layout should gracefully handle these optional fields being undefined.

Steps to reproduce

  1. Create a new tutorial file in en with frontmatter that omits featuredImage and authors:
title: My Tutorial
description: A test tutorial
category: introduction
  1. Start the dev server: npm run dev
  2. Navigate to /tutorials/my-tutorial/

Expected: Page renders normally Actual: TypeError crash

Would you like to work on the issue?

Yes

hxrshxz avatar Oct 18 '25 17:10 hxrshxz