Skip to content

Commit a92ddf4

Browse files
authored
Temporarily add tutorials survey on all pages(#2715)
* Add 2023 tutorials survey
1 parent 9ac7d09 commit a92ddf4

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

_static/css/custom2.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* Survey banner .css */
2+
3+
.survey-banner {
4+
margin-top: 10px;
5+
background-color: #f3f4f7;
6+
padding-top: 15px;
7+
padding-left: 10px;
8+
padding-bottom: 1px;
9+
}
10+
11+
@media screen and (max-width: 600px) {
12+
.survey-banner {
13+
padding-top: 5px;
14+
padding-left: 5px;
15+
padding-bottom: -1px;
16+
font-size: 12px;
17+
margin-bottom: 5px;
18+
}
19+
}

_templates/layout.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% extends "!layout.html" %}
22

3-
43
{%- block content %}
54
{{ super() }}
65
<script>
@@ -113,4 +112,14 @@
113112
</script>
114113

115114
<img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/795629140/?label=txkmCPmdtosBENSssfsC&amp;guid=ON&amp;script=0"/>
115+
116+
//temporarily add a link to survey
117+
<script>
118+
var survey = '<div class="survey-banner"><p><i class="fas fa-poll" aria-hidden="true">&nbsp </i> Take the annual <a href="https://forms.gle/jdNexNU6eZ8mCGDY7">PyTorch Tutorials survey</a>.</p></div>'
119+
if ($(".pytorch-call-to-action-links").length) {
120+
$(".pytorch-call-to-action-links").before(survey);
121+
} else {
122+
$("#pytorch-article").prepend(survey);
123+
}
124+
</script>
116125
{% endblock %}

conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ def reset_seeds(gallery_conf, fname):
285285

286286
html_css_files = [
287287
'https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css',
288-
'css/custom.css'
288+
'css/custom.css',
289+
'css/custom2.css'
289290
]
290291

291292
def setup(app):

0 commit comments

Comments
 (0)