feat(pathways): add canonical + Course JSON-LD to pathway pages#185
Merged
Conversation
Pathway pages had zero JSON-LD and no <link rel="canonical">. Adds: - <link rel="canonical"> via the shared absoluteUrl() helper - Course JSON-LD with a stable @id, matching the isPartOf: Course reference every lesson page already declares for its pathways (LessonJsonLd.astro) — that reference had no @id/url before this, so it was a dangling, unreferenceable node in the graph - about: DefinedTerm references derived from the union of topics covered by the pathway's own lessons, reusing the same controlled vocabulary lesson pages reference (no separate free-text list to drift out of sync) Course over ItemList/CollectionPage to stay consistent with the existing isPartOf convention rather than introduce a second type for the same concept. Left hasPart/itemListElement out — the page already renders the full lesson list and each lesson has its own JSON-LD, so enumerating them again on the Course node would be redundant weight for no real gain. Also fixes LessonJsonLd.astro's isPartOf Course stub to include the matching @id.
Lesson Validation Report
Blocking Errors (top 10)None Warnings (top 10)None Workflow logs: https://github.com/UC-OSPO-Network/education/actions/runs/29128154090 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Item 5 from the AI Discoverability Remediation Plan.
src/pages/pathways/[id].astrohad zero JSON-LD and no<link rel="canonical">.Design decision: represent a pathway as schema.org
Course, notItemList/CollectionPage. Every lesson page already declaresisPartOf: [{"@type": "Course", name: ...}]for its pathways (LessonJsonLd.astro) — that reference had no@id/url, so it was a dangling, unreferenceable node in the graph. KeepingCourseon the pathway side and giving it a stable@idfixes that instead of introducing a second type for the same concept.<link rel="canonical">via the sharedabsoluteUrl()helper (from fix(discoverability): base-path-aware URLs, RSS 404, orphaned lesson pages #183)CourseJSON-LD:name,description,url,provider(UC OSPO Network as curator — individual lessons still carry their own real publisher/sameAs), andabout—DefinedTermreferences derived from the union of topics covered by the pathway's own lessons, reusing the same controlled vocabulary lesson pages already reference rather than a second free-text list that could driftLessonJsonLd.astro: theisPartOfCourse stub now includes the matching@idDeliberately left out
hasPart/itemListElementenumerating every lesson — the page already renders the full lesson list and each lesson has its own JSON-LD, so re-enumerating on the Course node would be redundant weight for no real gain.Test plan
npm run buildsucceedsnpx astro check— 0 errors<link rel="canonical">present, JSON-LD parses as valid JSONintroduction-to-git)isPartOfnow includes@idmatching its pathway's canonical URL