personal website

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

@@ -1,133 +1,39 @@
11 ---
22 name: add-video
3-description: 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.
3+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.
44 ---
55
66 # Add Video to Portfolio
77
8-When user types `/add-video <URL>`, follow these steps exactly.
9-
10-## Step 1: Extract Video ID
11-
12-From the URL, extract the video ID:
13-- `youtube.com/watch?v=VIDEO_ID` → use VIDEO_ID
14-- `youtu.be/VIDEO_ID` → use VIDEO_ID
15-- `youtube.com/embed/VIDEO_ID` → use VIDEO_ID
8+When 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.
169
17-## Step 2: Fetch Video Title
18-
19-Use the YouTube oEmbed API to get the video title (no API key needed):
10+## Command
2011
12+```bash
13+node scripts/add-video.mjs "<URL>" ["Custom Title"] ["Category Name"]
2114 ```
22-https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v={VIDEO_ID}&format=json
23-```
2415
25-Fetch this URL and extract the `title` field from the JSON response. Use this title for:
26-- The iframe `title` attribute
27-- The `<h3 class="video-card-title">` text
16+- URL: any YouTube format (`watch?v=`, `youtu.be/`, `embed/`)
17+- Title: fetched from YouTube oEmbed unless overridden
18+- Category: defaults to `Deep Dives / Demos` unless overridden
2819
29-If the fetch fails, fall back to "Video" as the default title.
20+## On success
3021
31-## Step 3: Read index.html
22+Confirm 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.
3223
33-Read `index.html` and identify these 5 video cards by their HTML comments:
34-- `<!-- Horizontal Video Card 1 -->` - first large video
35-- `<!-- Horizontal Video Card 2 -->` - second large video
36-- `<!-- Small Video Card 1 -->` - first small video
37-- `<!-- Small Video Card 2 -->` - second small video
38-- `<!-- Small Video Card 3 -->` - third small video
24+## On failure
3925
40-Also find `<!-- More Videos Section -->` where archived videos go.
26+Report the script error (stderr). Do not fall back to manual HTML edits.
4127
42-## Step 4: Cascade Videos Down
28+## Data source
4329
44-Perform these moves in order:
30+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`.
4531
46-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).
32+## Rotation (unchanged)
4733
48-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.
49-
50-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.
51-
52-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.
53-
54-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.
55-
56-6. **New video → Horizontal Card 1**: Update Horizontal Card 1 with the new video:
57- - Set iframe src to `https://www.youtube.com/embed/{VIDEO_ID}`
58- - Set iframe title to the fetched YouTube title (from Step 2)
59- - Set `<h3 class="video-card-title">` to the fetched YouTube title
60- - Keep category as "Deep Dives / Demos" unless specified
61-
62-## Video Card Templates
63-
64-**Horizontal card (for positions 1-2):**
65-```html
66- <!-- Horizontal Video Card 1 -->
67- <article class="video-card video-card-horizontal">
68- <div class="video-thumbnail video-thumbnail-16-9">
69- <iframe
70- src="https://www.youtube.com/embed/{VIDEO_ID}"
71- title="{TITLE}"
72- frameborder="0"
73- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
74- allowfullscreen
75- style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
76- </iframe>
77- </div>
78- <div class="video-info">
79- <span class="video-category">{CATEGORY}</span>
80- <h3 class="video-card-title">{TITLE}</h3>
81- </div>
82- </article>
83-```
84-
85-**Small card (for positions 1-3 and More section):**
86-```html
87- <!-- Small Video Card 1 -->
88- <article class="video-card video-card-small">
89- <div class="video-thumbnail video-thumbnail-16-9">
90- <iframe
91- src="https://www.youtube.com/embed/{VIDEO_ID}"
92- title="{TITLE}"
93- frameborder="0"
94- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
95- allowfullscreen
96- style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
97- </iframe>
98- </div>
99- <div class="video-info">
100- <span class="video-category">{CATEGORY}</span>
101- <h3 class="video-card-title">{TITLE}</h3>
102- </div>
103- </article>
104-```
105-
106-## Example
107-
108-Input: `/add-video https://www.youtube.com/watch?v=abc123`
109-
110-Before:
111-- Horizontal 1: Video A
112-- Horizontal 2: Video B
113-- Small 1: Video C
114-- Small 2: Video D
115-- Small 3: Video E
116-- More: [Video F, Video G...]
117-
118-After:
119-- Horizontal 1: **NEW VIDEO** (abc123)
120-- Horizontal 2: Video A
121-- Small 1: Video B (changed from horizontal to small class)
122-- Small 2: Video C
123-- Small 3: Video D
124-- More: [Video E, Video F, Video G...]
125-
126-## Optional Title/Category Override
127-
128-By default, the video title is fetched automatically from YouTube.
129-
130-If user wants to override the title: `/add-video URL "My Custom Title"`
131-If user wants to override title and category: `/add-video URL "My Custom Title" "Category Name"`
132-
133-User-provided values take precedence over the fetched YouTube title. Default category is "Deep Dives / Demos".
34+| Position | Role |
35+|----------|------|
36+| JSON index 0 | Horizontal Card 1 (new video) |
37+| 1 | Horizontal Card 2 |
38+| 2–4 | Small Cards 1–3 |
39+| 5+ | More section (archived) |