Skip to content

Conversation

@yashovardhan
Copy link
Member

@yashovardhan yashovardhan commented Nov 3, 2025

Add discourse comment feature in Tutorials for syncing with Builder Hub


Note

Adds Discourse-powered comments to tutorials with topic auto-discovery/teasers, wires env config, and expands Open Graph image meta.

  • Tutorial content:
    • Add discourseTopicId to frontmatter across multiple src/pages/tutorials/* pages.
  • UI/Theme:
    • Replace DiscourseComment with embed that normalizes URLs, auto-finds topicId via Discourse API, and optionally renders teaser content; loads a clean Discourse embed.
    • Update src/theme/MDXPage to extract first-paragraph teasers, pass page metadata and discourseTopicId to DiscourseComment, and use absolute cover image URLs.
  • Config:
    • Add DISCOURSE_API_KEY, DISCOURSE_API_USERNAME, DISCOURSE_CATEGORY_ID to customFields in docusaurus.config.js.
  • SEO:
    • Expand Open Graph image tags in SEO (og:image:secure_url, type, width/height, alt).

Written by Cursor Bugbot for commit d567072. This will update automatically on new commits. Configure here.

@yashovardhan yashovardhan requested review from a team as code owners November 3, 2025 17:11
@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
metamask-docs Ready Ready Preview Comment Nov 5, 2025 0:01am

cursor[bot]

This comment was marked as outdated.

@yashovardhan yashovardhan force-pushed the feat/tutorial-builder-hub branch from ba6576b to e96e742 Compare November 4, 2025 13:53
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@alexandratran alexandratran left a comment

Choose a reason for hiding this comment

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

To clarify, this PR will add a discourse comments section underneath each tutorial page, without affecting other parts of the UX? And this can't be previewed, only viewed once merged into production?

One comment I have is I'm not a fan of including the tutorial cover image at the top of each page. The text in the cover is the same as the already displayed title in most cases, so it feels redundant and takes up a lot of space.

Image

}

initializeEmbed()
}, [postUrl, discourseTopicId, DISCOURSE_API_KEY])
Copy link

Choose a reason for hiding this comment

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

Bug: Stale Closures from Incomplete Effect Dependencies

The useEffect dependency array is incomplete. The effect uses several variables that are not included in the dependencies: DISCOURSE_API_USERNAME, DISCOURSE_CATEGORY_ID, and metadata. Additionally, the functions findDiscussionTopic, loadCleanEmbed, searchExistingTopic, and normalizeEmbedUrl are defined in the component body and reference these variables, but React's exhaustive-deps rule would flag this. This can cause stale closures where the effect uses old values of these variables when they change, leading to incorrect API calls or search logic.

Fix in Cursor Fix in Web

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.

4 participants