Skip to content

Commit 2e27932

Browse files
committed
Update
1 parent 953e0e5 commit 2e27932

File tree

5 files changed

+336
-211
lines changed

5 files changed

+336
-211
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
html_context = {
208208
"theme_variables": theme_variables,
209209
"library_links": theme_variables.get("library_links", []),
210-
"feedback_url": "https://github.com/pytorch/pytorch",
210+
"feedback_url": "https://github.com/pytorch/pytorch_sphinx_theme",
211211
"github_url": "https://github.com",
212212
"github_user": "pytorch",
213213
"github_repo": "pytorch_sphinx_theme",

pytorch_sphinx_theme2/templates/404.html

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,69 @@
4444
});
4545
})();
4646
</script>
47+
<!-- Conditional CSS for header and footer height adjustment -->
48+
{% if not theme_show_lf_header or not theme_show_lf_footer %}
49+
<style>
50+
{
51+
% if not theme_show_lf_header %
52+
}
53+
54+
:root {
55+
--header-height: 0px !important;
56+
--header-height-desktop: 0px !important;
57+
}
58+
59+
{
60+
% endif %
61+
}
62+
63+
{
64+
% if not theme_show_lf_footer %
65+
}
66+
67+
@media (min-width: 1100px) {
68+
.site-footer {
69+
height: 300px !important;
70+
}
71+
}
72+
73+
{
74+
% endif %
75+
}
76+
</style>
77+
{% endif %}
4778
{% endblock extrahead %}
4879

49-
{% block body %}
50-
<article class="bd-article" id="pytorch-article">
51-
<div class="container text-center error-404-container">
52-
<h1 class="error-404-title">404</h1>
53-
<h2 class="error-404-subtitle">Page Not Found</h2>
54-
<p class="error-404-text">The page you are looking for might have been removed, had its name changed, or is
55-
temporarily unavailable.</p>
56-
<div class="error-404-buttons">
57-
<a href="{{ html_baseurl or '/' }}" class="btn btn-primary error-404-button">
58-
Back Home <i class="fa fa-arrow-right" aria-hidden="true"></i>
59-
</a>
60-
<a href="{{ theme_feedback_url|default('https://github.com/pytorch/pytorch') }}/issues/new?template=documentation.yml&labels=module:%20docs,broken-link"
61-
class="btn btn-secondary error-404-button error-404-issue-button">
62-
Found a broken link? File an issue <i class="fa-brands fa-github" aria-hidden="true"></i>
63-
</a>
80+
{% block body_tag %}
81+
82+
<body data-feedback-url="{{ feedback_url }}" class="pytorch-body">
83+
{% if theme_show_lf_header %}
84+
{% include "pytorch_header.html" %}
85+
{% endif %}
86+
{{ super() }}
87+
{% endblock %}
88+
89+
{% block body %}
90+
<article class="bd-article" id="pytorch-article">
91+
<div class="container text-center error-404-container">
92+
<h1 class="error-404-title">404</h1>
93+
<h2 class="error-404-subtitle">Page Not Found</h2>
94+
<p class="error-404-text">The page you are looking for might have been removed, had its name changed, or is
95+
temporarily unavailable.</p>
96+
<div class="error-404-buttons">
97+
<a href="{{ html_baseurl or '/' }}" class="btn btn-primary error-404-button">
98+
Back Home <i class="fa fa-arrow-right" aria-hidden="true"></i>
99+
</a>
100+
<a href="{{ theme_feedback_url|default('https://github.com/pytorch/pytorch') }}/issues/new?template=documentation.yml&labels=module:%20docs,broken-link"
101+
class="btn btn-secondary error-404-button error-404-issue-button">
102+
Found a broken link? File an issue <i class="fa-brands fa-github" aria-hidden="true"></i>
103+
</a>
104+
</div>
64105
</div>
65-
</div>
66-
</article>
106+
</article>
107+
{% endblock body %}
67108

68-
{% endblock body %}
109+
{% block footer%}
110+
{% include "pytorch_footer.html" %}
111+
{{ super() }}
112+
{% endblock %}

0 commit comments

Comments
 (0)