Add blog chapters to newsletter content selection#238
Conversation
Adds blog_chapter query to the content CTE in the newsletter SQL. Still needs: URL handling in collected CTE, JS rendering with first-3-paragraph truncation and [... word count] suffix, chapter state management, and extras count integration. https://claude.ai/code/session_01Df7tNiUDSXVwvF1yeChynr
|
Claude finished @simonw's task —— View job Code Review CompleteTodo List:
Review Feedback✅ Code Quality & Best Practices
✅ SQL Query Correctness
|
- Query guides_chapter/guides_guide tables from Datasette API
- Render chapter markdown with marked.js, extract first 3 paragraphs
- Append [... N words] suffix linking to full chapter (matching blog display)
- Show guide breadcrumb ("Agentic Engineering Patterns >") above each chapter
- Include chapters in extras count and support deletion from preview
https://claude.ai/code/session_01Df7tNiUDSXVwvF1yeChynr
Deploying tools with
|
| Latest commit: |
1fd0fa6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ad2eaf15.tools-b1q.pages.dev |
| Branch Preview URL: | https://claude-add-guide-chapters-rk.tools-b1q.pages.dev |
|
Claude finished @simonw's task —— View job Code Review Complete ✅Todo List:
Review Feedback✅ Overall AssessmentThis is a well-implemented feature that cleanly extends the newsletter system to include blog chapters. The code follows existing patterns and maintains consistency with the current architecture. 🔍 SQL Query ReviewLocation: Strengths:
Security: ✅ No SQL injection risks - the query uses only column references and string literals. 🎯 Code Quality & Best PracticesExcellent:
JavaScript Integration:
⚡ Performance ConsiderationsGood:
Minor Note: The query complexity is reasonable for the dataset size, and the UNION structure is already established. 🐛 Potential IssuesNone identified. The implementation is solid with:
📝 Suggestions for Enhancement (Optional)
🧪 Testing ConsiderationsCurrent Status: The code integrates with existing testing patterns through the live data source. Recommendations:
📊 Security Assessment✅ No security concerns identified:
ConclusionThis is a clean, well-implemented addition that extends the newsletter system naturally. The code follows established patterns, handles edge cases appropriately, and integrates seamlessly with existing functionality. Approved for merge. 🚀 |

This change extends the blog-to-newsletter query to include published blog chapters as potential content for newsletters.
Summary
Added a new UNION clause to the content selection query that retrieves published chapters from the
blog_chaptertable, joining with theblog_guidetable to include guide metadata.Key Changes
is_draft = 0https://simonwillison.net/guides/{guide_slug}/{chapter_slug}/Implementation Details
type = 'chapter'blog_guideto ensure only chapters with valid guides are includedhttps://claude.ai/code/session_01Df7tNiUDSXVwvF1yeChynr