Перейти до основного вмісту
← 📄 HTML & the platform·Модуль A6 · Урок 7
ЗавданняAdd a JSON-LD Article block to the head: @type 'Article', headline 'Why FastAPI', author 'Anna' (Person), datePublished '2026-05-20T10:00:00Z', image 'https://example.com/og.png', publisher 'CodeMentor' (Organization) with logo url 'https://example.com/logo.png'.

Стаття JSON-LD: право на розширені результати

125 XP9 min
Теорія

What rich results look like

Google's search results sometimes show a thumbnail + author + date alongside the standard blue-link snippet. These "rich results" are eligible ONLY for pages with valid structured data matching one of Schema.org's types. For a blog post, the type is Article (or its subtypes NewsArticle, BlogPosting).

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "Why FastAPI beats Flask in 2026",
  "author": {
    "@type": "Person",
    "name": "Anna Kowalski"
  },
  "datePublished": "2026-05-20T10:00:00Z",
  "image": "https://example.com/og.png",
  "publisher": {
    "@type": "Organization",
    "name": "CodeMentor AI",
    "logo": {
      "@type": "ImageObject",
      "url": "https://example.com/logo.png"
    }
  }
}
</script>

Required fields for Article

Google's rich-result requirements (minimum to be eligible):

  • headline — the article title.
  • image — a URL (1200×630 minimum).
  • datePublished — ISO 8601.
  • author — Person or Organization.
  • publisher — Organization (required for AMP, recommended otherwise).

NewsArticle adds

dateModified, articleBody, articleSection — only fill these if relevant.

Where to put it

Inside <head> or at the start of <body>. The script tag has type="application/ld+json" (NOT application/json — that's different). Browsers ignore the script (it's not JS). Google reads it.

Test before shipping

Paste your URL into Google's "Rich Results Test" tool. It tells you which type your data qualifies for + flags missing required fields. Run before deploy.

🔒

Зареєструйся щоб кодувати

Теорія відкрита всім. Інтерактивний редактор, живий перегляд і перевірка відкриваються з 7-денним безкоштовним trial — потрібна картка, скасування у будь-який час.

Реєстрація — безкоштовний trial →

Перші 10 уроків у кожному треку — безкоштовні. Картка не потрібна.

← НазадНаступний урок →

Отримуй одну пораду з Python чи вебу — щодня поштою

Коротко, без води, без спаму. Відписка — в один клік.