Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compilation Error with ld+json script and razor views

Tags:

I m trying to add some schema.org stuff to my site and the razor view engine is giving me troubles. Here is what I am trying to add to my main layout:

  <script type="application/ld+json"> 
        {
        "@context": "http://schema.org",
        "@type": "Organization",
        "url": "http://www.example.com",
        "logo": "http://www.example.com/media.ashx/repzio-icon.png"
        }
    </script>

The @context is the issue here, how do I get around this?

like image 621
Slee Avatar asked May 05 '15 14:05

Slee


1 Answers

Escape it with @@:

Markup

<script type="application/ld+json"> 
        {
        "@@context": "http://schema.org",
        "@@type": "Organization",
        "url": "http://www.example.com",
        "logo": "http://www.example.com/media.ashx/repzio-icon.png"
        }
    </script>

View Source

Source

like image 126
hutchonoid Avatar answered Sep 28 '22 01:09

hutchonoid