Add new tutorial: #1 Embedding p5.js with an iframe#1007
Add new tutorial: #1 Embedding p5.js with an iframe#1007hxrshxz wants to merge 6 commits intoprocessing:2.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a new tutorial on embedding p5.js sketches via iframes and introduces a defensive fix in the tutorial layout to avoid crashes when optional frontmatter is missing.
- New tutorial: Embedding p5.js with iframes, including examples, performance tips, and accessibility notes
- New category: beyond-web-editor added to tutorials config
- Layout fix: Optional chaining for authors and featuredImage in TutorialLayout to prevent runtime errors
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/layouts/TutorialLayout.astro | Uses optional chaining for authors and featuredImage to avoid crashes when missing. |
| src/content/tutorials/en/embedding-p5-with-iframe.mdx | Adds comprehensive tutorial content with examples and code snippets. |
| src/content/tutorials/config.ts | Registers new tutorial category beyond-web-editor. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
27d704f to
9c21440
Compare
src/layouts/TutorialLayout.astro
Outdated
| locale={currentLocale} | ||
| description={entry.data.authors.join(", ")} | ||
| featuredImageSrc={entry.data.featuredImage.src} | ||
| description={entry.data.description} |
There was a problem hiding this comment.
Hi @hxrshxz ! Could you revert this change, please? Or was it intentional? It's important to maintain the authorship info for the tutorials
There was a problem hiding this comment.
Hey @ksen0 sorry I have reverted it back it was based on the copilot's suggestion above which ig I misunderstood

…torial description
|
@ksen0 please have a look, thank you |
Addresses #999
Description
Adds new tutorial "Embedding p5.js with an iframe" to the 2.0 branch and fixes a bug in TutorialLayout.
Changes
embedding-p5-with-iframe.mdx- Comprehensive guide on embedding p5.js sketches using iframes"beyond-web-editor"to tutorials configTutorialLayout.astrofor optionalfeaturedImageandauthorsfields to prevent crashesTutorial Details
The optional chaining fix prevents TypeError when tutorials don't include the optional
featuredImageorauthorsfrontmatter fields.