0

I'm using middleman to generate HTML, I wish to output a json-ld-object, something like this:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Person",
  "name": "John Doe",
  "jobTitle": "Graduate research assistant",
  "affiliation": "University of Dreams",
  "additionalName": "Johnny",
  "url": "http://www.example.com",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "1234 Peach Drive",
    "addressLocality": "Wonderland",
    "addressRegion": "Georgia"
  }
}
</script>

I have the data structured in the right way in an object, is there a good way to output it?

1

1 Answer 1

0

To output it in the right format it should be like:

%script{type: 'application/ld+json'}
:plain
  {
    "@context": "http://schema.org",
    "@type": "Person",
    "name": "John Doe",
    "jobTitle": "Graduate research assistant",
    "affiliation": "University of Dreams",
    "additionalName": "Johnny",
    "url": "http://www.example.com",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "1234 Peach Drive",
      "addressLocality": "Wonderland",
      "addressRegion": "Georgia"
    }
  }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.