Commit 299d2f49
299d2f498f02Merged
Justin Dorfman <[email protected]> · 6 months ago · 9 files · +5 added · ~4 modified
Description
feat: manage portfolio videos via videos.json (#66)
- feat: manage portfolio videos via videos.json and scripts
Move long-form videos to data/videos.json with render/add scripts so /add-video updates JSON and regenerates index.html instead of manual HTML cascading.
Co-Authored-By: Codex Opus 4.6 (1M context) [email protected] Co-authored-by: Cursor [email protected] Entire-Checkpoint: e89b447d9973
- feat: add goose + Deep Search MCP portfolio video
Feature the new demo as Horizontal Card 1 and rotate prior videos down.
Co-authored-by: Cursor [email protected] Entire-Checkpoint: 27f1681fb942
Co-authored-by: Codex Opus 4.6 (1M context) [email protected] Co-authored-by: Cursor [email protected]
Details
- Commit
- 299d2f498f02
- Parent
- 37f55b3ec1bf
.cursor/skills/add-video/SKILL.mdmodifiedView file
---name: add-videodescription: Add a new YouTube video to the portfolio. New video becomes Horizontal Video Card 1, all other videos shift down, oldest goes to More section. Use when user types /add-video followed by a YouTube URL.description: Add a new YouTube video to the portfolio. New video becomes Horizontal Video Card 1, all others shift down, oldest goes to More section. Use when user types /add-video followed by a YouTube URL.---# Add Video to PortfolioWhen user types `/add-video <URL>`, follow these steps exactly.## Step 1: Extract Video IDFrom the URL, extract the video ID:- `youtube.com/watch?v=VIDEO_ID` → use VIDEO_ID- `youtu.be/VIDEO_ID` → use VIDEO_ID- `youtube.com/embed/VIDEO_ID` → use VIDEO_IDWhen the user types `/add-video <URL>` (optional quoted title and category), run the add script from the repo root. Do **not** edit video HTML in `index.html` by hand.## Step 2: Fetch Video TitleUse the YouTube oEmbed API to get the video title (no API key needed):## Command```bashnode scripts/add-video.mjs "<URL>" ["Custom Title"] ["Category Name"]```https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v={VIDEO_ID}&format=json```Fetch this URL and extract the `title` field from the JSON response. Use this title for:- The iframe `title` attribute- The `<h3 class="video-card-title">` text- URL: any YouTube format (`watch?v=`, `youtu.be/`, `embed/`)- Title: fetched from YouTube oEmbed unless overridden- Category: defaults to `Deep Dives / Demos` unless overriddenIf the fetch fails, fall back to "Video" as the default title.## On success## Step 3: Read index.htmlConfirm the video title and that it is now **Horizontal Video Card 1** (featured). Mention `/git` if the user wants to commit and open a PR.Read `index.html` and identify these 5 video cards by their HTML comments:- `<!-- Horizontal Video Card 1 -->` - first large video- `<!-- Horizontal Video Card 2 -->` - second large video- `<!-- Small Video Card 1 -->` - first small video- `<!-- Small Video Card 2 -->` - second small video- `<!-- Small Video Card 3 -->` - third small video## On failureAlso find `<!-- More Videos Section -->` where archived videos go.Report the script error (stderr). Do not fall back to manual HTML edits.## Step 4: Cascade Videos Down## Data sourcePerform these moves in order:Videos are stored newest-first in `data/videos.json`. The script updates JSON and regenerates the marked section in `index.html` via `scripts/render-videos.mjs`.1. **Small Card 3 → More section**: Copy the entire `<article>` from Small Card 3 and insert it at the START of the More section's `<div class="video-grid">`, right after the `<!-- Archived videos appear here -->` comment (push existing archived videos down).## Rotation (unchanged)2. **Small Card 2 → Small Card 3**: Replace Small Card 3's `<article>` content with Small Card 2's content. Keep the `<!-- Small Video Card 3 -->` comment.3. **Small Card 1 → Small Card 2**: Replace Small Card 2's `<article>` content with Small Card 1's content. Keep the `<!-- Small Video Card 2 -->` comment.4. **Horizontal Card 2 → Small Card 1**: Replace Small Card 1's `<article>` with Horizontal Card 2's content, but change the class from `video-card-horizontal` to `video-card-small`. Keep the `<!-- Small Video Card 1 -->` comment.5. **Horizontal Card 1 → Horizontal Card 2**: Replace Horizontal Card 2's `<article>` content with Horizontal Card 1's content. Keep the `<!-- Horizontal Video Card 2 -->` comment.6. **New video → Horizontal Card 1**: Update Horizontal Card 1 with the new video: - Set iframe src to `https://www.youtube.com/embed/{VIDEO_ID}` - Set iframe title to the fetched YouTube title (from Step 2) - Set `<h3 class="video-card-title">` to the fetched YouTube title - Keep category as "Deep Dives / Demos" unless specified## Video Card Templates**Horizontal card (for positions 1-2):**```html <!-- Horizontal Video Card 1 --> <article class="video-card video-card-horizontal"> <div class="video-thumbnail video-thumbnail-16-9"> <iframe src="https://www.youtube.com/embed/{VIDEO_ID}" title="{TITLE}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"> </iframe> </div> <div class="video-info"> <span class="video-category">{CATEGORY}</span> <h3 class="video-card-title">{TITLE}</h3> </div> </article>```**Small card (for positions 1-3 and More section):**```html <!-- Small Video Card 1 --> <article class="video-card video-card-small"> <div class="video-thumbnail video-thumbnail-16-9"> <iframe src="https://www.youtube.com/embed/{VIDEO_ID}" title="{TITLE}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"> </iframe> </div> <div class="video-info"> <span class="video-category">{CATEGORY}</span> <h3 class="video-card-title">{TITLE}</h3> </div> </article>```## ExampleInput: `/add-video https://www.youtube.com/watch?v=abc123`Before:- Horizontal 1: Video A- Horizontal 2: Video B- Small 1: Video C- Small 2: Video D- Small 3: Video E- More: [Video F, Video G...]After:- Horizontal 1: **NEW VIDEO** (abc123)- Horizontal 2: Video A- Small 1: Video B (changed from horizontal to small class)- Small 2: Video C- Small 3: Video D- More: [Video E, Video F, Video G...]## Optional Title/Category OverrideBy default, the video title is fetched automatically from YouTube.If user wants to override the title: `/add-video URL "My Custom Title"`If user wants to override title and category: `/add-video URL "My Custom Title" "Category Name"`User-provided values take precedence over the fetched YouTube title. Default category is "Deep Dives / Demos".| Position | Role ||----------|------|| JSON index 0 | Horizontal Card 1 (new video) || 1 | Horizontal Card 2 || 2–4 | Small Cards 1–3 || 5+ | More section (archived) |AGENTS.mdmodifiedView file
Loading diff…
README.mdmodifiedView file
Loading diff…
data/videos.jsonaddedView file
Loading diff…
index.htmlmodifiedView file
Loading diff…
scripts/add-video.mjsaddedView file
Loading diff…
scripts/migrate-videos-to-json.mjsaddedView file
Loading diff…
scripts/render-videos.mjsaddedView file
Loading diff…
scripts/video-lib.mjsaddedView file
Loading diff…