p5.js-website
p5.js-website copied to clipboard
TutorialLayout crashes rendering tutorials without optional featuredImage and authors fields
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:
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
- Create a new tutorial file in
enwith frontmatter that omitsfeaturedImageandauthors:
title: My Tutorial
description: A test tutorial
category: introduction
- Start the dev server: npm run dev
- Navigate to /tutorials/my-tutorial/
Expected: Page renders normally Actual: TypeError crash
Would you like to work on the issue?
Yes