File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 75
75
< a href ="{{ link['href'] }} "> {% trans %}json{% endtrans %}</ a >
76
76
{% elif link['rel'] == 'alternate' and link['type'] and link['type'] == 'application/ld+json' %}
77
77
{% set links_found.jsonld = 1 %}
78
+ {% set jsonld_href = link['href'] %}
78
79
< a href ="{{ link['href'] }} "> {% trans %}jsonld{% endtrans %}</ a >
79
80
{% endif %}
80
81
{% endfor %}
114
115
< script >
115
116
// Requests and embeds JSON-LD representation of current page
116
117
var xhr = new XMLHttpRequest ( ) ;
118
+ { % if links_found . jsonld == 0 - % }
119
+ var path = { { jsonld_href } } ;
120
+ { % - else - % }
117
121
var path = window . location . protocol + "//" + window . location . host + window . location . pathname + "?f=jsonld" ;
122
+ { % - endif % }
118
123
xhr . open ( 'GET' , path ) ;
119
124
xhr . onload = function ( ) {
120
125
if ( xhr . status === 200 ) {
You can’t perform that action at this time.
0 commit comments