|
1 | 1 | {% extends "!layout.html" %} |
2 | 2 |
|
3 | 3 | {% block extrahead %} |
4 | | -{{ super() }} |
5 | | -<script> |
6 | | - // Fix static asset paths for 404 page on static hosting |
7 | | - (function () { |
8 | | - // Skip on localhost/development |
9 | | - if (window.location.hostname === 'localhost' || |
10 | | - window.location.hostname === '127.0.0.1') { |
11 | | - return; |
12 | | - } |
| 4 | +<!DOCTYPE html> |
| 5 | + <html> |
| 6 | + <head> |
| 7 | + <meta charset="UTF-8"> |
| 8 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 9 | + <title> 404 - Page Not Found </title> |
| 10 | + </head> |
13 | 11 |
|
14 | | - // Get the base path for _static assets |
15 | | - let basePath = '/'; |
16 | | - |
17 | | - // On docs.pytorch.org, use first subdirectory (e.g. /tutorials, /docs) as base |
18 | | - if (window.location.hostname === 'docs.pytorch.org') { |
19 | | - const pathParts = window.location.pathname.split('/').filter(part => part); |
20 | | - if (pathParts.length > 0) { |
21 | | - basePath = '/' + pathParts[0] + '/'; |
22 | | - } |
23 | | - } |
| 12 | +<base href="{{ theme_canonical_url }}"> |
| 13 | +<script type="text/javascript" src="_static/js/theme.js"></script> |
| 14 | +<link rel="stylesheet" type="text/css" href="_static/styles/bootstrap.css" crossorigin="anonymous"> |
| 15 | +<link rel="stylesheet" type="text/css" href="_static/styles/pydata-sphinx-theme.css" crossorigin="anonymous"> |
| 16 | +<link rel="preconnect" href="https://fonts.googleapis.com"> |
| 17 | +<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 18 | +<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400&display=swap" rel="stylesheet"> |
| 19 | +<link rel="stylesheet" type="text/css" href="_static/css/theme.css" crossorigin="anonymous"> |
| 20 | +<meta property="og:image" content="_static/img/pytorch_seo.png" /> |
| 21 | +<link rel="stylesheet" href="_static/webfonts/all.min.css" crossorigin="anonymous"> |
| 22 | +<meta http-equiv="Content-Security-Policy" |
| 23 | + content="default-src * 'unsafe-inline' 'unsafe-eval' data: blob:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval' blob:;"> |
| 24 | +<meta name="pytorch_project" content="{{ pytorch_project }}"> |
24 | 25 |
|
25 | | - // Fix CSS links |
26 | | - document.querySelectorAll('link[href*="_static"]').forEach(link => { |
27 | | - if (!link.href.startsWith('http') && !link.href.startsWith('/')) { |
28 | | - link.href = basePath + link.getAttribute('href'); |
29 | | - } |
30 | | - }); |
31 | 26 |
|
32 | | - // Fix script sources |
33 | | - document.querySelectorAll('script[src*="_static"]').forEach(script => { |
34 | | - if (!script.src.startsWith('http') && !script.src.startsWith('/')) { |
35 | | - script.src = basePath + script.getAttribute('src'); |
36 | | - } |
37 | | - }); |
38 | | - |
39 | | - // Fix image sources |
40 | | - document.querySelectorAll('img[src*="_static"]').forEach(img => { |
41 | | - if (!img.src.startsWith('http') && !img.src.startsWith('/')) { |
42 | | - img.src = basePath + img.getAttribute('src'); |
43 | | - } |
44 | | - }); |
45 | | - })(); |
46 | | -</script> |
| 27 | +<script async src="https://cse.google.com/cse.js?cx=e65585f8c3ea1440e"></script> |
| 28 | +{{ super() }} |
47 | 29 | <!-- Conditional CSS for header and footer height adjustment --> |
48 | 30 | {% if not theme_show_lf_header or not theme_show_lf_footer %} |
49 | 31 | <style> |
|
87 | 69 | {% endblock %} |
88 | 70 |
|
89 | 71 | {% 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="{{ pathto(master_doc) }}" 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> |
| 72 | + {% include "components/searchbox.html" %} |
| 73 | + <div class="container text-center error-404-container"> |
| 74 | + <h1 class="error-404-title">404</h1> |
| 75 | + <h2 class="error-404-subtitle">Page Not Found</h2> |
| 76 | + <p class="error-404-text">The page you are looking for might have been removed, had its name changed, or is |
| 77 | + temporarily unavailable.</p> |
| 78 | + <div class="error-404-buttons"> |
| 79 | + <a href="http://localhost:8000/" class="btn btn-primary error-404-button"> |
| 80 | + Back Home <i class="fa fa-arrow-right" aria-hidden="true"></i> |
| 81 | + </a> |
| 82 | + <a href="{{ theme_feedback_url|default('https://github.com/pytorch/pytorch') }}/issues/new?template=documentation.yml&labels=module:%20docs,broken-link" |
| 83 | + class="btn btn-secondary error-404-button error-404-issue-button"> |
| 84 | + Found a broken link? File an issue <i class="fa-brands fa-github" aria-hidden="true"></i> |
| 85 | + </a> |
105 | 86 | </div> |
106 | | - </article> |
107 | | - {% endblock body %} |
| 87 | + </div> |
| 88 | + {% endblock %} |
108 | 89 |
|
109 | 90 | {% block footer%} |
110 | 91 | {% include "pytorch_footer.html" %} |
111 | 92 | {{ super() }} |
112 | 93 | {% endblock %} |
| 94 | +</body> |
| 95 | +</html> |
0 commit comments