As your Vasion partner, IQIT helps you get the most out of every platform update. Let's talk.
const categoryClasses = { 'certification': 'cat-certification', 'product-update': 'cat-product-update', 'news': 'cat-news' }; function formatDate(dateStr) { return new Date(dateStr).toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' }); } function getCategorySlug(cat) { return cat.toLowerCase().replace(/\s+/g, '-'); } function escHtml(s) { if (s == null) return ''; return String(s).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,'''); } async function loadPost() { const params = new URLSearchParams(window.location.search); const slug = params.get('slug'); const container = document.getElementById('postContent'); const heroTitle = document.getElementById('heroTitle'); if (!slug) { container.innerHTML = '
No post specified. Back to blog
'; return; } try { const resp = await fetch('/api/blog/' + encodeURIComponent(slug)); if (resp.status === 404) { container.innerHTML = '
'; return; } if (!resp.ok) throw new Error('Failed to load'); const post = await resp.json(); const catSlug = getCategorySlug(post.category); const catLabel = categoryLabels[catSlug] || post.category; const catClass = categoryClasses[catSlug] || ''; document.title = post.title + ' | IQIT Blog'; document.getElementById('pageDesc').content = post.summary; heroTitle.textContent = post.title; const tags = post.tags ? post.tags.split(',').map(t => t.trim()).filter(Boolean) : []; container.innerHTML = `
`; } catch(e) { container.innerHTML = '
Could not load this post. Back to blog
'; } } loadPost();