Skip to content

Commit 1d7d651

Browse files
committed
Update sphinx footer for non-LF projects
1 parent bbe196c commit 1d7d651

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@
225225
# "canonical_url": "https://pytorch.org/docs/stable/",
226226
"canonical_url": "http://localhost:8000",
227227
#"pytorch_project": "tutorials",
228+
#"show_lf_header": False,
229+
#"show_lf_footer": False,
228230
}
229231

230232

pytorch_sphinx_theme2/static/js/theme.js

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pytorch_sphinx_theme2/templates/footer-rating.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343
© <a href="{{ pathto('copyright') }}">
4444
{% trans copyright=copyright|e %}Copyright {{ copyright }}{% endtrans %}
4545
</a>.<br/>
46-
{% else %}
47-
{% trans copyright=copyright|e %}
48-
© Copyright {{ copyright }}.
49-
{% endtrans %}
50-
<br/>
5146
{% endif %}
5247
</p>
5348

pytorch_sphinx_theme2/templates/pytorch_footer.html

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{% if theme_show_lf_footer %}
2+
13
<div class="container-fluid docs-tutorials-resources" id="docs-tutorials-resources">
24
<div class="container">
35
<div class="row">
@@ -21,11 +23,36 @@ <h2>Resources</h2>
2123
</div>
2224
</div>
2325
</div>
26+
{% endif%}
27+
28+
{% if not theme_show_lf_footer %}
29+
<style>
30+
.site-footer {
31+
padding: 20px 40px;
32+
height: 60px !important;
33+
}
34+
35+
@media screen and (min-width: 768px) {
36+
.site-footer {
37+
padding: 20px 40px;
38+
}
39+
}
40+
41+
.site-footer .privacy-policy {
42+
border-top: none;
43+
margin-top: 0px;
44+
}
45+
46+
.site-footer .privacy-policy .copyright {
47+
padding-top: 0;
48+
}
49+
</style>
50+
{% endif %}
2451

2552
<footer class="site-footer">
53+
{% if theme_show_lf_footer %}
2654
<div class="container footer-container">
2755

28-
{% if theme_show_lf_footer %}
2956
<div class="newsletter" id="newsletter">
3057

3158
<p class="newsletter__title is-style-max-width-800"><strong>Stay in touch</strong> for updates, event info, and
@@ -48,7 +75,6 @@ <h2>Resources</h2>
4875
href="https://www.linuxfoundation.org/privacy/">Privacy Policy</a>.</p>
4976

5077
</div>
51-
{% endif %}
5278

5379
<div class="lf-grid">
5480
<ul class="social-links">
@@ -98,10 +124,10 @@ <h2>Resources</h2>
98124
</a></li>
99125
</ul>
100126
</div>
101-
127+
{% endif %}
102128
<div class="privacy-policy">
103129
<div class="copyright">
104-
{% if theme_show_lf_footer %}
130+
{% if theme_show_lf_footer %}
105131
<p>
106132
&copy; PyTorch. Copyright © The Linux Foundation®. All rights reserved. The Linux Foundation has registered
107133
trademarks and uses trademarks. For more information, including terms of use, privacy policy, and trademark

0 commit comments

Comments
 (0)