Skip to content

Commit

Permalink
Merge pull request #1188 from kinow/always-have-a-jsonld-element
Browse files Browse the repository at this point in the history
Modify code to always have an ld json element, may be empty
  • Loading branch information
kouralex authored Aug 23, 2021
2 parents de0b0f7 + 1d5b7fa commit 3d05609
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions view/scripts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ var pluginParameters = {{ plugin_params|raw }};
{% endif %}
</script>

{% if request.page == 'page' and search_results and search_results|length == 1 %}
<script type="application/ld+json">
{% if search_results and search_results|length == 1 %}
{{ search_results|first.dumpJsonLd|raw }}
</script>
{% else %}
{}
{% endif %}
</script>
<script src="vendor/components/jquery/jquery.min.js"></script>
<script src="vendor/components/jqueryui/jquery-ui.min.js"></script>
<script src="vendor/components/handlebars.js/handlebars.min.js"></script>
Expand Down

0 comments on commit 3d05609

Please sign in to comment.