Skip to content

Commit 55fc600

Browse files
committed
Add programmable Google Search to pytorch tutorials site
1 parent 08a61b7 commit 55fc600

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

_templates/layout.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,32 @@
1111
</script>
1212
{%- endblock %}
1313

14+
{% block sidebartitle %}
15+
{% if theme_display_version %}
16+
{%- set nav_version = version %}
17+
{% if READTHEDOCS and current_version %}
18+
{%- set nav_version = current_version %}
19+
{% endif %}
20+
{% if nav_version %}
21+
<div class="version">
22+
{{ nav_version }}
23+
</div>
24+
{% endif %}
25+
{% endif %}
26+
<div class="searchbox">
27+
<script async src="https://cse.google.com/cse.js?cx=e65585f8c3ea1440e"></script>
28+
<div class="gcse-search"></div>
29+
</div>
30+
<!-- JavaScript to remove search-icon background image -->
31+
<script>
32+
window.addEventListener('load', function() {
33+
var input = document.querySelector('.gsc-input input[type=text]');
34+
if (input) {
35+
input.style.backgroundImage = 'none';
36+
}
37+
});
38+
</script>
39+
{% endblock %}
1440

1541
{% block footer %}
1642
{{ super() }}

0 commit comments

Comments
 (0)