/* qg-seo-schema.js - site-wide structured data */ (function(){ // Organization + Person + WebSite as a JSON-LD graph var graph = { "@context": "https://schema.org", "@graph": [ { "@type": "Organization", "@id": "https://quitting.ghost.io/#organization", "name": "Quitting", "url": "https://quitting.ghost.io/", "logo": { "@type": "ImageObject", "url": "https://storage.ghost.io/c/a5/f6/a5f6cd98-9f6d-4d07-9d88-a8aaf537ba51/content/images/2026/04/logo-the-quit.png", "width": 512, "height": 512 }, "sameAs": [ "https://x.com/QuittingGhostio" ], "founder": { "@id": "https://quitting.ghost.io/#person-jonathan" } }, { "@type": "Person", "@id": "https://quitting.ghost.io/#person-jonathan", "name": "Jonathan Hale", "url": "https://quitting.ghost.io/about/", "jobTitle": "Author", "description": "Writer in long-term recovery. Building a science-based field guide to quitting drinking.", "sameAs": [ "https://x.com/QuittingGhostio" ] }, { "@type": "WebSite", "@id": "https://quitting.ghost.io/#website", "url": "https://quitting.ghost.io/", "name": "Quitting", "description": "Free science-based tools, articles and tips on sobriety and practical exercises to support quitting drinking.", "publisher": { "@id": "https://quitting.ghost.io/#organization" }, "inLanguage": "en-US" } ] }; var s = document.createElement('script'); s.type = 'application/ld+json'; s.id = 'qg-jsonld-graph'; s.textContent = JSON.stringify(graph); document.head.appendChild(s); // BreadcrumbList: derive from URL path. e.g., /drink-calculator/ -> Home > Drink Calculator try { var path = location.pathname.replace(/^\/+|\/+$/g, ''); if (!path || path === 'index.html') return; var parts = path.split('/').filter(Boolean); var items = [{ "@type": "ListItem", position: 1, name: "Home", item: "https://quitting.ghost.io/" }]; var acc = "https://quitting.ghost.io"; parts.forEach(function(seg, i){ acc += '/' + seg; var name = seg.replace(/-/g, ' ').replace(/\b\w/g, function(c){ return c.toUpperCase(); }); items.push({ "@type": "ListItem", position: i + 2, name: name, item: acc + '/' }); }); var crumbs = { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": items }; var c = document.createElement('script'); c.type = 'application/ld+json'; c.id = 'qg-jsonld-breadcrumbs'; c.textContent = JSON.stringify(crumbs); document.head.appendChild(c); } catch (e) {} })();