Skip to content

Add schema.org LearningResource markup and individual item landing pages#40

Merged
likeajumprope merged 8 commits into
ReproNim:mainfrom
jgrethe:main
Jun 11, 2026
Merged

Add schema.org LearningResource markup and individual item landing pages#40
likeajumprope merged 8 commits into
ReproNim:mainfrom
jgrethe:main

Conversation

@jgrethe

@jgrethe jgrethe commented Apr 29, 2026

Copy link
Copy Markdown

Summary

  • Adds schema.org LearningResource JSON-LD markup (as an ItemList) injected into <head> on the main browse page for improved SEO and structured data
  • Adds individual item landing pages at /#/item/:id (hash routing for GitHub Pages compatibility) with per-item LearningResource JSON-LD
  • Card titles now link to the item landing page; external "Access Material" links are preserved unchanged
  • identifier field uses the item's landing page URL (e.g. https://repronim.github.io/ReproInventory/#/item/1)
  • isAccessibleForFree set to true for all items
  • Adds react-router-dom for client-side routing
  • Extracts a shared useInventoryData hook used by both pages
  • Adds workflow_dispatch trigger to the deploy workflow for manual runs

Test plan

  • Browse page loads and materials display correctly
  • Card titles link to /#/item/:id landing pages
  • "Access Material" external links open the resource URL in a new tab
  • Item landing page displays full detail for each item
  • <head> contains <script type="application/ld+json"> with schema.org markup after data loads (check DevTools Elements panel)
  • Deploy workflow can be triggered manually via Actions tab

🤖 Generated with Claude Code

jgrethe and others added 4 commits April 28, 2026 12:17
- 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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread frontend/src/lib/schema-org.ts Outdated
Comment thread frontend/src/lib/schema-org.ts Outdated
Comment thread frontend/dist/data/reproinventory_data.json Outdated
Comment thread frontend/src/hooks/useInventoryData.ts Outdated
@jgrethe

jgrethe commented Apr 29, 2026

Copy link
Copy Markdown
Author

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.

@likeajumprope likeajumprope self-assigned this May 3, 2026
likeajumprope and others added 4 commits June 11, 2026 10:16
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>
Copilot AI added a commit that referenced this pull request Jun 11, 2026
…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
@likeajumprope likeajumprope merged commit 36a7bc6 into ReproNim:main Jun 11, 2026
4 of 7 checks passed
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