# How to add a schema for each blog post?

**URL:** https://talk.jekyllrb.com/t/how-to-add-a-schema-for-each-blog-post/1149
**Category:** Help
**Created:** [November 5, 2017, 4:12pm UTC](https://talk.jekyllrb.com/t/how-to-add-a-schema-for-each-blog-post/1149 "2017-11-05T16:12:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![yashumittal](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/yashumittal/32/1260_2.png) [@yashumittal](https://talk.jekyllrb.com/u/yashumittal)
#### Post date: [November 5, 2017, 4:12pm UTC](https://talk.jekyllrb.com/t/how-to-add-a-schema-for-each-blog-post/1149/1 "2017-11-05T16:12:43Z")

</div>

How to add a schema for each blog post, is there is any additional plugin do we need to install?

**For example:**

```json
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "NewsArticle",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://google.com/article"
  },
  "headline": "Article headline",
  "image": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
   ],
  "datePublished": "2015-02-05T08:00:00+08:00",
  "dateModified": "2015-02-05T09:20:00+08:00",
  "author": {
    "@type": "Person",
    "name": "John Doe"
  },
   "publisher": {
    "@type": "Organization",
    "name": "Google",
    "logo": {
      "@type": "ImageObject",
      "url": "https://google.com/logo.jpg"
    }
  },
  "description": "A most wonderful article"
}
</script>

```

---

<div class="post-metadata">

### Author: ![jpl](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jpl/32/575_2.png) [@jpl](https://talk.jekyllrb.com/u/jpl)
#### Post date: [November 7, 2017, 9:35am UTC](https://talk.jekyllrb.com/t/how-to-add-a-schema-for-each-blog-post/1149/2 "2017-11-07T09:35:29Z")

</div>

You can save the file inside \_include folder and

## Option 1

{% include myfile.html %}

in the blog post

or

## Option 2

Check what layout your blog is using, for example,

```auto
---
layout: mylayout
---

```

then edit \_layout/mylayout.html and add the schema there

Hope this helps.

Cheers

---

<div class="post-metadata">

### Author: ![Frank](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/frank/32/26_2.png) [@Frank](https://talk.jekyllrb.com/u/Frank)
#### Post date: [November 7, 2017, 8:53pm UTC](https://talk.jekyllrb.com/t/how-to-add-a-schema-for-each-blog-post/1149/3 "2017-11-07T20:53:38Z")

</div>

jekyll-seo-tag plugin has limited support for JSON LD ouput

> **[jekyll/jekyll-seo-tag](https://github.com/jekyll/jekyll-seo-tag#about-jekyll-seo-tag)**
>
> A Jekyll plugin to add metadata tags for search engines and social networks to better index and display your site's content. - jekyll/jekyll-seo-tag

---

<div class="post-metadata">

### Author: ![alwillis](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/alwillis/32/592_2.png) [@alwillis](https://talk.jekyllrb.com/u/alwillis)
#### Post date: [November 14, 2017, 8:01am UTC](https://talk.jekyllrb.com/t/how-to-add-a-schema-for-each-blog-post/1149/4 "2017-11-14T08:01:24Z")

</div>

I create JSON-LD templates; there are lots of new and updated schemas that don’t have plugin support.

- create templates for the schemas you want.

Here’s one for [WebSite](http://schema.org/WebSite) located at `_includes/index.jsonld`:

```json
{
  "@context": "http://schema.org",
  "@type": "WebSite",
  "name": "{{ site.title }}",
  "url": "{{ site.url }}",
  "description": "{{ site.description }}",
  "dateModified": "{{ site.time | date_to_xmlschema }}",
  "creator": {
    "@type": "Person",
    "name": "John Doe"
   }
}

```

- include it in your layout:

```auto
<script type="application/ld+json">
  {% include index.jsonld %}
</script>

```
