diff options
author | rubenwardy <rw@rubenwardy.com> | 2019-02-02 17:05:18 +0000 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2019-02-02 17:05:18 +0000 |
commit | e40b247a9740e21d68116c2d28d51c40bdd042da (patch) | |
tree | 3f4246e16a50f19c4fa4bb33c08daf68fed54ab7 | |
parent | a79cc758edd201cb878326c7f6d846a4761daefd (diff) | |
download | cheatdb-e40b247a9740e21d68116c2d28d51c40bdd042da.tar.xz |
Add OpenSearch and Google site search support
-rw-r--r-- | app/public/static/opensearch.xml | 9 | ||||
-rw-r--r-- | app/templates/base.html | 1 | ||||
-rw-r--r-- | app/templates/index.html | 15 |
3 files changed, 25 insertions, 0 deletions
diff --git a/app/public/static/opensearch.xml b/app/public/static/opensearch.xml new file mode 100644 index 0000000..3fae00c --- /dev/null +++ b/app/public/static/opensearch.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> + <ShortName>ContentDB</ShortName> + <LongName>ContentDB</LongName> + <InputEncoding>UTF-8</InputEncoding> + <Description>Search mods, games, and textures for Minetest.</Description> + <Tags>Minetest Mod Game Subgame Search</Tags> + <Url type="text/html" method="get" template="https://content.minetest.net/packages?q={searchTerms}"/> +</OpenSearchDescription> diff --git a/app/templates/base.html b/app/templates/base.html index 09ca939..facdd63 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -8,6 +8,7 @@ <title>{% block title %}title{% endblock %} - {{ config.USER_APP_NAME }}</title> <link rel="stylesheet" type="text/css" href="/static/bootstrap.css"> <link rel="stylesheet" type="text/css" href="/static/custom.css?v=6"> + <link rel="search" type="application/opensearchdescription+xml" href="/static/opensearch.xml" title="ContentDB" /> {% block headextra %}{% endblock %} </head> diff --git a/app/templates/index.html b/app/templates/index.html index e11b3c8..4d54b2d 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -4,6 +4,21 @@ Welcome {% endblock %} +{% block scriptextra %} +<script type="application/ld+json"> +{ + "@context": "https://schema.org", + "@type": "WebSite", + "url": "https://content.minetest.net/", + "potentialAction": { + "@type": "SearchAction", + "target": "https://content.minetest.net/packages?q={search_term_string}", + "query-input": "required name=search_term_string" + } +} +</script> +{% endblock %} + {% block content %} <!-- <header class="jumbotron"> <div class="container"> |