Skip to content

Conversation

@hxrshxz
Copy link
Contributor

@hxrshxz hxrshxz commented Oct 18, 2025

Addresses #999

Description

Adds new tutorial "Embedding p5.js with an iframe" to the 2.0 branch and fixes a bug in TutorialLayout.

Changes

  • New tutorial: embedding-p5-with-iframe.mdx - Comprehensive guide on embedding p5.js sketches using iframes
  • New category: Added "beyond-web-editor" to tutorials config
  • Bug fix: Added optional chaining in TutorialLayout.astro for optional featuredImage and authors fields to prevent crashes

Tutorial Details

  • Category: beyond-web-editor
  • Authors: hxrshxz, Dave Pagurek
  • Covers: iframe basics, global mode, multiple sketches, security, responsive design, and best practices

The optional chaining fix prevents TypeError when tutorials don't include the optional featuredImage or authors frontmatter fields.

Copilot AI review requested due to automatic review settings October 18, 2025 18:52
@hxrshxz hxrshxz changed the title git commit -m "Add new tutorial: Embedding p5.js with an iframe" Add new tutorial: Embedding p5.js with an iframe Oct 18, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hxrshxz hxrshxz force-pushed the tutorial-iframe-2.0 branch from 27d704f to 9c21440 Compare October 18, 2025 19:11
@hxrshxz hxrshxz changed the title Add new tutorial: Embedding p5.js with an iframe Add new tutorial: #1 Embedding p5.js with an iframe Oct 19, 2025
locale={currentLocale}
description={entry.data.authors.join(", ")}
featuredImageSrc={entry.data.featuredImage.src}
description={entry.data.description}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hxrshxz ! Could you revert this change, please? Or was it intentional? It's important to maintain the authorship info for the tutorials

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ksen0 sorry I have reverted it back it was based on the copilot's suggestion above which ig I misunderstood
image

@hxrshxz hxrshxz requested a review from ksen0 October 19, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants