Skip to content

Commit

Permalink
Add site scoped search structured data
Browse files Browse the repository at this point in the history
This allows google to show a fancy search box in the results.
I don’t believe this will happen, but let’s try anyways.
  • Loading branch information
horazont committed Oct 4, 2019
1 parent 51274ed commit a57cbab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions muchopper/web/templates/room_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@
{% block head_includes %}
{{ super() }}
<link rel="canonical" href="{{ url_for('room_list', pageno=page.page) }}">
{% if page.page == 1 %}
{# only show this on the home page #}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": "{{ url_for('index', _external=True) }}",
"potentialAction": {
"@type": "SearchAction",
"target": "{{ url_for('search', _external=True) }}?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
{% endif %}
{% endblock %}
{% block content %}
{{ pagination() }}
Expand Down

0 comments on commit a57cbab

Please sign in to comment.