Skip to content

Commit cfcbdc4

Browse files
committed
Simplify media processing workflow - direct markdown generation
🎯 Simplified Approach: - Remove intermediate JSON processing step - Direct markdown generation from URLs - Users can edit final markdown files directly ✨ Enhanced Features Retained: - YouTube video support (title, channel, thumbnail) - Duplicate prevention (won't overwrite existing files) - Smart metadata extraction with validation - Proper fallback handling πŸ—‘οΈ Removed: - extractMediaMetadata.js (intermediate JSON extraction) - generateMediaFromJson.js (JSON to markdown conversion) - Complex two-step workflow πŸ’‘ User Experience: - Single command generates markdown directly - Edit markdown files manually if needed - Simpler workflow with same powerful features - Clear tips in console output about direct editing
1 parent 0fbba67 commit cfcbdc4

8 files changed

Lines changed: 238 additions & 664 deletions

β€Ž.github/workflows/content-automation.ymlβ€Ž

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ jobs:
8484
- name: Generate media from press URLs
8585
if: steps.changes.outputs.press_changed == 'true'
8686
run: |
87-
echo "Running media extraction from press.txt..."
88-
node src/scripts/extractMediaMetadata.js
89-
echo "Generating markdown from extracted metadata..."
90-
node src/scripts/generateMediaFromJson.js
87+
echo "Running media generation from press.txt..."
88+
node src/scripts/generateMediaMd.js
9189
9290
- name: Generate videos from YouTube URLs
9391
if: steps.changes.outputs.videos_changed == 'true'
@@ -118,9 +116,6 @@ jobs:
118116
git add src/content/media/
119117
git add src/content/videos/
120118
121-
# Add intermediate metadata files for manual editing
122-
git add press-metadata.json
123-
124119
# Create descriptive commit message
125120
COMMIT_MSG="Auto-generate content from updated files"
126121

β€ŽREADME.mdβ€Ž

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This website includes GitHub Actions automation that automatically generates con
5757
| File | Generates | Script Used | Content Location |
5858
|------|-----------|-------------|------------------|
5959
| `dois.txt` | Publications | `bulkImportPublications.js` | `src/content/publications/` |
60-
| `press.txt` | Media mentions | `extractMediaMetadata.js` β†’ `generateMediaFromJson.js` | `src/content/media/` |
60+
| `press.txt` | Media mentions | `generateMediaMd.js` | `src/content/media/` |
6161
| `videos.txt` | Video content | `generateVideosMd.js` | `src/content/videos/` |
6262

6363
#### πŸš€ Quick Usage
@@ -92,42 +92,33 @@ You can also run the scripts manually:
9292
# Generate publications from DOIs
9393
node src/scripts/bulkImportPublications.js dois.txt
9494

95-
# Generate media from press URLs (two-step process)
96-
node src/scripts/extractMediaMetadata.js # Creates press-metadata.json
97-
node src/scripts/generateMediaFromJson.js # Generates markdown from JSON
95+
# Generate media from press URLs
96+
node src/scripts/generateMediaMd.js
9897

9998
# Generate videos from YouTube URLs
10099
node src/scripts/generateVideosMd.js
101100
```
102101

103102
#### πŸ“ Enhanced Media Processing
104103

105-
The media processing uses a **two-step workflow** for better quality control:
106-
107-
1. **Extract Metadata** (`extractMediaMetadata.js`):
108-
- Processes URLs from `press.txt`
109-
- Creates `press-metadata.json` with extracted metadata
110-
- Supports both **web articles** and **YouTube videos**
111-
- Identifies entries that need manual review
112-
113-
2. **Generate Markdown** (`generateMediaFromJson.js`):
114-
- Reads from `press-metadata.json`
115-
- Generates final markdown files
116-
- Preserves manual edits to the JSON file
117-
118-
**Benefits:**
119-
- βœ… **Manual editing**: Edit `press-metadata.json` to fix titles, dates, descriptions
120-
- βœ… **YouTube support**: Extracts video title, channel name, thumbnail
121-
- βœ… **Duplicate prevention**: Won't reprocess URLs unless forced
122-
- βœ… **Quality indicators**: Flags entries needing manual review
123-
- βœ… **Incremental updates**: Only processes new URLs
124-
125-
**Editing Workflow:**
126-
1. Add URLs to `press.txt` and commit
127-
2. Automation creates/updates `press-metadata.json`
128-
3. **Manually edit the JSON file** if needed (fix dates, titles, etc.)
129-
4. Commit the JSON changes
130-
5. Automation regenerates markdown files
104+
The media processing includes enhanced features:
105+
106+
**✨ Features:**
107+
- βœ… **YouTube support**: Handles YouTube videos alongside web articles
108+
- βœ… **Duplicate prevention**: Won't recreate existing files
109+
- βœ… **Smart extraction**: Gets title, description, publish date, author
110+
- βœ… **Direct editing**: Edit the generated markdown files directly
111+
112+
**🎯 YouTube Support:**
113+
- Extracts video title, channel name, and thumbnail
114+
- Adds `youtubeId`, `channelName`, and `thumbnailUrl` fields
115+
- Includes note about manual date verification (YouTube oEmbed doesn't provide publish dates)
116+
117+
**✏️ Manual Editing:**
118+
- Generated markdown files can be edited directly
119+
- Fix titles, dates, descriptions, or add project associations
120+
- Changes persist - existing files won't be overwritten
121+
- Add content below the frontmatter as needed
131122

132123
#### πŸ”§ Advanced Options
133124

β€Žsrc/content/media/2025-07-11-article-title-manual-edit-required.mdβ€Ž

Lines changed: 0 additions & 17 deletions
This file was deleted.

β€Žsrc/content/media/2025-07-11-the-truth-about-burning-waymos.mdβ€Ž

Lines changed: 0 additions & 19 deletions
This file was deleted.

β€Žsrc/content/media/2025-07-11-youtube.mdβ€Ž

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
Β (0)