File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 7575 < a href ="{{ link['href'] }} "> {% trans %}json{% endtrans %}</ a >
7676 {% elif link['rel'] == 'alternate' and link['type'] and link['type'] == 'application/ld+json' %}
7777 {% set links_found.jsonld = 1 %}
78+ {% set jsonld_href = link['href'] %}
7879 < a href ="{{ link['href'] }} "> {% trans %}jsonld{% endtrans %}</ a >
7980 {% endif %}
8081 {% endfor %}
114115 < script >
115116 // Requests and embeds JSON-LD representation of current page
116117 var xhr = new XMLHttpRequest ( ) ;
118+ { % if links_found . jsonld == 1 - % }
119+ var path = "{{ jsonld_href }}" ;
120+ { % - else - % }
117121 var path = window . location . protocol + "//" + window . location . host + window . location . pathname + "?f=jsonld" ;
122+ { % - endif % }
118123 xhr . open ( 'GET' , path ) ;
119124 xhr . onload = function ( ) {
120125 if ( xhr . status === 200 ) {
You can’t perform that action at this time.
0 commit comments