IQIT Blog

Loading...

Loading article...

Want to Deploy These Features?

As your Vasion partner, IQIT helps you get the most out of every platform update. Let's talk.

Get in Touch
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 = '

Post not found

Back to blog

'; 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 = `
${escHtml(catLabel)} ${formatDate(post.publishedAt)} By ${escHtml(post.author)}
${post.featuredImageUrl ? `${post.featuredImageAlt || post.title}` : ''}
${DOMPurify.sanitize(post.body)}
${tags.length ? `
${tags.map(t => `${escHtml(t)}`).join('')}
` : ''}
${escHtml(post.author)}
Your Vasion Print Management Partner

Share this post

← All Posts
`; } catch(e) { container.innerHTML = '

Could not load this post. Back to blog

'; } } loadPost();