diff options
-rw-r--r-- | public/views.py | 2 | ||||
-rw-r--r-- | templates/base.html | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/public/views.py b/public/views.py index 7dd0528c..16f5db22 100644 --- a/public/views.py +++ b/public/views.py @@ -25,10 +25,12 @@ def index(request): else: def updates(): return get_recent_updates() + domain = "%s://%s" % (request.scheme, request.META['HTTP_HOST']) context = { 'news_updates': News.objects.order_by('-postdate', '-id')[:15], 'pkg_updates': updates, 'staff_groups': StaffGroup.objects.all(), + 'domain': domain, } return render(request, 'public/index.html', context) diff --git a/templates/base.html b/templates/base.html index f6fe99e5..fae2037e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -81,6 +81,18 @@ the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis.</p> </div> </div> + <script type="application/ld+json"> + { + "@context": "http://schema.org", + "@type": "WebSite", + "url": "{{ domain }}/", + "potentialAction": { + "@type": "SearchAction", + "target": "{{ domain }}/packages/?q={search_term}", + "query-input": "required name=search_term" + } + } + </script> {% block script_block %}{% endblock %} </body> </html> |