Repository navigation
feat(projects): overview rendering + View on GitHub button + optional assets/build-step - #38
Conversation
…al assets/build-step Adds three things visitors asked for: 1. **'View on GitHub' button** prominently in the header of every project page. Was a small text link in the sidebar; now a real button with the GitHub octocat icon. 2. **Project overview** rendered above the embed (or in place of it for projects without a live demo). Pulled from the source repo's README.md (or whatever path 'overview.path' declares) at request time, rendered with marked, edge-cached for 5 minutes. Failure is non-fatal — broken README → inline notice + repo link. 3. **Build-step support** for the reusable workflow. Manifests can now declare 'build.script' (transforms source → upload-ready) and 'build.aptPackages' (declarative apt install before the script). Use cases: optimize media (ffmpeg), compile WASM (emcc/cargo), convert notebooks to HTML (jupyter nbconvert), run TypeScript build, etc. Schema breaking changes: - 'assets' is now optional (was 'min(1)'). Empty assets renders an overview-only page. Tests updated. - 'delivery' and 'build' are optional iff 'assets' is empty. - 'overview' is a new optional manifest field; defaults to README.md / skipFirstHeading=true. The normalized shape always sets overview to a NormalizedOverview even when omitted, so UI code never has to check. 178 / 178 tests passing (was 163; +12 overview lib + +3 schema).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10c7509381
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </a> | ||
| </header> | ||
| {overviewResult.ok ? ( | ||
| <Fragment set:html={overviewResult.html} /> |
There was a problem hiding this comment.
Sanitize README HTML before injection
When a discovered repo's README contains raw HTML, this injects it directly into the project page. The discovery job searches all public repos by topic:codeseys-embed (src/scripts/sync-project-manifests.ts builds the query without an owner filter), so a third-party repo with a valid manifest can supply README HTML such as event handlers/scripts that will execute on this site; sanitize or disable raw HTML before passing it to set:html.
Useful? React with 👍 / 👎.
| delivery: Delivery.optional(), | ||
| build: Build.optional(), |
There was a problem hiding this comment.
Require delivery metadata when assets exist
Making delivery and build independently optional lets a v2 manifest with non-empty assets but no delivery pass validation and get written into the content collection. In that scenario hasDemo is true, but the detail page gates ProjectViewer on entry.delivery, so the declared playable assets silently disappear instead of the manifest being rejected; add a refinement that only allows missing delivery/build when assets is omitted or empty.
Useful? React with 👍 / 👎.
🚀 Preview deployedURL: https://1f0a88fd-codeseys-personal-website.codeseys.workers.dev Updated on every push to this PR. |
Summary
Three changes to /projects/[slug]:
build.script+build.aptPackagesPlus schema relaxation to support overview-only projects (no live demo, just a portfolio page).
Companion change
web-embed-workflows#3 (next PR) extends the reusable workflow with apt-install + build-script steps.
Tests
178 / 178 (was 163). +12 overview-lib tests, +3 schema-update tests.
🤖 Generated with the help of Claude