docs: Add manual blog publishing workflow to curation docs

Documents the proven mongosh-based method for directly publishing
blog posts, including schema, production paths, and verification steps.

Note: Pre-commit hook flags existing example violations in this doc
(they demonstrate what inst_016/017/018 violations look like).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
TheFlow 2026-02-08 18:08:17 +13:00
parent 6de4dab9a9
commit b9b72d99e0

View file

@ -561,6 +561,111 @@ mongosh tractatus_dev --eval "
---
## Quick Reference: Manual Blog Publishing (via mongosh)
When you have a finished blog post and want to publish it directly (bypassing the AI curation pipeline), use this method. This is the proven approach — used successfully on 2026-02-08.
### Prerequisites
- SSH access: `ssh -i ~/.ssh/tractatus_deploy ubuntu@vps-93a693da.vps.ovh.net`
- Production database: `mongodb://localhost:27017/tractatus`
- Collection: `blog_posts`
- Production app path: `/var/www/tractatus/`
### Step 1: Create a mongosh insert script
Create a local file (e.g., `/tmp/insert-blog-post.js`) with this structure:
```javascript
// /tmp/insert-blog-post.js
db = db.getSiblingDB('tractatus');
db.blog_posts.insertOne({
title: "Your Blog Post Title",
slug: "your-blog-post-title-slugified",
subtitle: "Optional subtitle",
author: "Author Name",
content: `<p>Your HTML content here.</p>
<h2>Section Heading</h2>
<p>More content...</p>`,
excerpt: "A short summary for the blog listing page.",
tags: ["tag1", "tag2", "tag3"],
status: "published",
featured: false,
publishedAt: new Date(),
createdAt: new Date(),
updatedAt: new Date()
});
print("Blog post inserted successfully");
print("URL: https://agenticgovernance.digital/blog-post.html?slug=your-blog-post-title-slugified");
```
**Important**: Content must be HTML (not markdown). The blog renders content via `innerHTML`.
### Step 2: Upload and execute on production
```bash
# Upload the script
scp -i ~/.ssh/tractatus_deploy /tmp/insert-blog-post.js \
ubuntu@vps-93a693da.vps.ovh.net:/tmp/insert-blog-post.js
# Execute it
ssh -i ~/.ssh/tractatus_deploy ubuntu@vps-93a693da.vps.ovh.net \
"mongosh --quiet mongodb://localhost:27017/tractatus /tmp/insert-blog-post.js"
# Clean up
ssh -i ~/.ssh/tractatus_deploy ubuntu@vps-93a693da.vps.ovh.net \
"rm /tmp/insert-blog-post.js"
```
### Step 3: Verify
```bash
# Check via API
curl -s "https://agenticgovernance.digital/api/blog/your-slug-here" | python3 -m json.tool | head -5
# View in browser
# https://agenticgovernance.digital/blog-post.html?slug=your-slug-here
# Also listed on: https://agenticgovernance.digital/blog.html
```
### Blog post schema fields
| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `title` | String | Yes | Display title |
| `slug` | String | Yes | URL-safe, lowercase, hyphens. Must be unique |
| `subtitle` | String | No | Shown below title |
| `author` | String | Yes | Author name |
| `content` | String | Yes | **HTML** (not markdown) |
| `excerpt` | String | Yes | Short summary for listing page |
| `tags` | Array | No | String array for categorization |
| `status` | String | Yes | `"published"` or `"draft"` |
| `featured` | Boolean | No | Highlights on blog listing |
| `publishedAt` | Date | Yes | Publication timestamp |
| `createdAt` | Date | Yes | Creation timestamp |
| `updatedAt` | Date | Yes | Last update timestamp |
### Deploying frontend changes (navbar, blog page, etc.)
The Tractatus deploy script handles cache busting and rsync:
```bash
cd ~/projects/tractatus
# Frontend only (public/ directory)
./scripts/deploy.sh --frontend-only --yes
# Single file (manual scp)
scp -i ~/.ssh/tractatus_deploy public/js/components/navbar.js \
ubuntu@vps-93a693da.vps.ovh.net:/var/www/tractatus/public/js/components/navbar.js
```
**Production paths**: App root is `/var/www/tractatus/` (NOT `/home/ubuntu/tractatus/`). The `/home/ubuntu/tractatus/` directory only contains a `scripts/` folder.
---
## Next Steps
### Future Enhancements