Merge pull request #1818 from metalivedev/655-searchswiftype
Add Swiftype search to docs
This commit is contained in:
commit
37186d9ef4
2 changed files with 45 additions and 0 deletions
27
docs/theme/docker/layout.html
vendored
27
docs/theme/docker/layout.html
vendored
|
@ -110,6 +110,13 @@
|
||||||
|
|
||||||
<div class="span3 sidebar bs-docs-sidebar">
|
<div class="span3 sidebar bs-docs-sidebar">
|
||||||
{{ toctree(collapse=False, maxdepth=3) }}
|
{{ toctree(collapse=False, maxdepth=3) }}
|
||||||
|
<form>
|
||||||
|
<input type="text" id="st-search-input" class="st-search-input span3" style="width:160px;" />
|
||||||
|
</form>
|
||||||
|
<a href="http://swiftype.com?ref=pb">
|
||||||
|
<img id="swiftype-img" src="http://swiftype.com/assets/media/swiftype-logo-lightbg-small.png"
|
||||||
|
alt="Search by Swiftype" />
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- body block -->
|
<!-- body block -->
|
||||||
|
@ -121,6 +128,26 @@
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- Swiftype search -->
|
||||||
|
<div id="st-results-container"></div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var Swiftype = window.Swiftype || {};
|
||||||
|
(function() {
|
||||||
|
Swiftype.key = 'pWPnnyvwcfpcrw1o51Sz';
|
||||||
|
Swiftype.inputElement = '#st-search-input';
|
||||||
|
Swiftype.resultContainingElement = '#st-results-container';
|
||||||
|
Swiftype.attachElement = '#st-search-input';
|
||||||
|
Swiftype.renderStyle = "overlay";
|
||||||
|
|
||||||
|
var script = document.createElement('script');
|
||||||
|
script.type = 'text/javascript';
|
||||||
|
script.async = true;
|
||||||
|
script.src = "//swiftype.com/embed.js";
|
||||||
|
var entry = document.getElementsByTagName('script')[0];
|
||||||
|
entry.parentNode.insertBefore(script, entry);
|
||||||
|
}());
|
||||||
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
18
docs/theme/docker/static/css/main.css
vendored
18
docs/theme/docker/static/css/main.css
vendored
|
@ -391,3 +391,21 @@ dt:hover > a.headerlink {
|
||||||
float: right;
|
float: right;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Swiftype style */
|
||||||
|
|
||||||
|
#st-search-input {
|
||||||
|
margin-right: 14px;
|
||||||
|
margin-left: 9px;
|
||||||
|
height: 19px;
|
||||||
|
width: 120px;
|
||||||
|
|
||||||
|
}
|
||||||
|
#swiftype-img {
|
||||||
|
border: none;
|
||||||
|
width: 145px;
|
||||||
|
height: auto;
|
||||||
|
margin: 0px auto;
|
||||||
|
margin-left: 13px;
|
||||||
|
margin-top: -30px;
|
||||||
|
}
|
Loading…
Reference in a new issue