Blog surfaced (header nav, home strip, footer) + five seed articles with kit-derived covers and the seed/publish tooling; zones: network tier default OFF until NAS is switched on at the end of testing

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-09 06:24:55 -05:00
parent 0a6e219229
commit 3eda2fe0cc
23 changed files with 120 additions and 14 deletions
+16
View File
@@ -0,0 +1,16 @@
// Runs INSIDE the LinkSpin container: node /tmp/blog-publish.js [draft]
// Seeds the posts in /tmp/blog-seed.json through blog.save() (same path Admin > Blog uses). Skips slugs that exist.
// Default status is published (Marty asked for the blog built out like InstantAdPay's); pass "draft" to seed drafts.
const fs = require('fs');
const blog = require('/app/blog.js');
blog.init({ dataDir: process.env.DATA_DIR || '/app/data' });
const status = process.argv[2] === 'draft' ? 'draft' : 'published';
(async () => {
const posts = JSON.parse(fs.readFileSync('/tmp/blog-seed.json', 'utf8'));
for (const p of posts) {
if (await blog.get(p.slug)) { console.log('exists ', p.slug); continue; }
const r = await blog.save(Object.assign({}, p, { status }), null);
console.log(r.error ? 'ERROR ' + p.slug + ': ' + r.error : (status + ' ' + r.post.slug + ' (' + r.post.body.split(/\s+/).length + ' words)'));
}
const all = await blog.listAll(); console.log('total posts:', all.length, '| published:', all.filter(x => x.status === 'published').length);
})().catch(e => { console.error('ERR', e.message); process.exit(1); });