Skip to content
MVT Blog Generator

MostVisionTech — Blog Generator

Fill the form, save the post, then download the ready-to-upload files.

Saved Posts

Loading…
Paste just the article content (the part that changes each time) — no need to include nav, footer, or CSS. Those are added automatically.
`; } function buildListingHTML(){ const cards = posts.filter(p=>!p.existing || p.body).map(p => ` ${p.image ? `${p.title}` : ''}
${p.tag}

${p.title}

${p.excerpt}

📅 ${p.date}
`).join(''); return ` Blog — Most Vision Tech

Blog

${cards}
`; } function downloadFile(filename, content){ const blob = new Blob([content], {type:'text/html'}); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = filename; document.body.appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url); } document.getElementById('downloadPostBtn').addEventListener('click', ()=>{ const data = readForm(); if(!data.title || !data.body){ setStatus('Fill in Title and Article Body first.'); return; } downloadFile(data.slug + '.html', buildPostHTML(data)); setStatus('Downloaded ' + data.slug + '.html — paste this into your post page.'); }); document.getElementById('downloadListingBtn').addEventListener('click', ()=>{ if(!posts.length){ setStatus('No saved posts yet.'); return; } downloadFile('blog-listing.html', buildListingHTML()); setStatus('Downloaded blog-listing.html — this replaces your /blog/ page content.'); }); document.getElementById('downloadAllBtn').addEventListener('click', async ()=>{ if(!posts.length){ setStatus('No saved posts yet.'); return; } const zip = new JSZip(); posts.filter(p=>p.slug && p.body).forEach(p => zip.file(p.slug + '.html', buildPostHTML(p))); zip.file('blog-listing.html', buildListingHTML()); const blob = await zip.generateAsync({type:'blob'}); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'mvt-blog-all.zip'; document.body.appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url); setStatus('Downloaded mvt-blog-all.zip — every post page (with updated sidebars) + the listing page.'); }); loadPosts(); newPost();