How do I add structured data json script to Pug JS

45 views Asked by At

I am trying to add in a script of json that is structured data for SEO into my Pug JS file. I am doing it the same way I do JavaScript with type="text/javascript", but it does not compile and I keep getting errors. Is it a syntax issue? Please tell me what I am doing wrong, thank you.

script(type="application/ld+json"{ "@context": "https://schema.org", "@graph": [ { "@type": "WebPage", "@id": "https://www.example.io/some-page/", "url": "https://www.example.io/some-page/", "name": "Access Example's Knowledge Base", "isPartOf": { "@id": "https://www.example.io/#website" })
Unexpected character : expected `=`
Details:
    code: PUG:INVALID_KEY_CHARACTER
    msg: Unexpected character : expected `=`
    line: 14
    column: 53
Syntax Error: Unexpected token
Details:
    code: PUG:SYNTAX_ERROR
    msg: Syntax Error: Unexpected token
    line: 14
    column: 38
0

There are 0 answers