Add schema.org LearningResource markup and individual item landing pages#40
Conversation
- Add schema.org/LearningResource JSON-LD (ItemList) injected into <head> on the browse page - Add individual item landing pages at /#/item/:id with per-item JSON-LD - Add react-router-dom with HashRouter for GitHub Pages compatibility - Extract shared useInventoryData hook - Card titles now link to item pages; external URL links unchanged - identifier field uses repronim.inventory:<id> CURIE format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request implements routing for the ReproInventory frontend using react-router-dom, introducing a dedicated ItemPage and a useInventoryData hook for centralized data fetching. It also adds utilities to generate and inject Schema.org JSON-LD metadata for improved SEO. Feedback focuses on mitigating potential XSS vulnerabilities during script injection, ensuring type consistency for the last_updated field in the inventory data, and adopting safer TypeScript practices by avoiding the any type in catch blocks.
|
Hi @likeajumprope - I added some functionality to ReproInventory at the SOBP hackathon on a fork - support for schema.org markup and individual landing pages for the entries so that ReproInventory can be found via Google, etc. The indivudal pages have schema.org markup as well. This is running on Github pages from my fork: https://jgrethe.github.io/ReproInventory/ To see the schema.org markup - you can inspect the head element and it is the last item (json-ld content). Also, used this as a test scenario for working with Claude Code. |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…n fork PRs GitHub restricts GITHUB_TOKEN to read-only for pull_request_target workflows triggered by a fork PR that modifies any workflow file (even with an explicit `contents: write` declaration). PR #40 modifies deploy.yml, causing the 403 Permission denied when peaceiris/actions-gh-pages tries to push to gh-pages. Fix: split into two workflows following the GitHub-recommended workflow_run pattern: - pr-preview.yml: build-only (contents: read), uploads dist as artifact - pr-deploy.yml: triggered by workflow_run, always gets full write access from the base repository's token regardless of fork restrictions
Summary
LearningResourceJSON-LD markup (as anItemList) injected into<head>on the main browse page for improved SEO and structured data/#/item/:id(hash routing for GitHub Pages compatibility) with per-itemLearningResourceJSON-LDidentifierfield uses the item's landing page URL (e.g.https://repronim.github.io/ReproInventory/#/item/1)isAccessibleForFreeset totruefor all itemsreact-router-domfor client-side routinguseInventoryDatahook used by both pagesworkflow_dispatchtrigger to the deploy workflow for manual runsTest plan
/#/item/:idlanding pages<head>contains<script type="application/ld+json">with schema.org markup after data loads (check DevTools Elements panel)🤖 Generated with Claude Code