|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>Redirecting...</title> |
| 7 | + <style> |
| 8 | + body { |
| 9 | + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; |
| 10 | + max-width: 600px; |
| 11 | + margin: 50px auto; |
| 12 | + padding: 20px; |
| 13 | + text-align: center; |
| 14 | + } |
| 15 | + .redirect-message { |
| 16 | + background: #f8f9fa; |
| 17 | + border: 1px solid #e9ecef; |
| 18 | + border-radius: 8px; |
| 19 | + padding: 20px; |
| 20 | + margin: 20px 0; |
| 21 | + } |
| 22 | + .spinner { |
| 23 | + border: 3px solid #f3f3f3; |
| 24 | + border-top: 3px solid #007bff; |
| 25 | + border-radius: 50%; |
| 26 | + width: 30px; |
| 27 | + height: 30px; |
| 28 | + animation: spin 1s linear infinite; |
| 29 | + margin: 20px auto; |
| 30 | + } |
| 31 | + @keyframes spin { |
| 32 | + 0% { transform: rotate(0deg); } |
| 33 | + 100% { transform: rotate(360deg); } |
| 34 | + } |
| 35 | + </style> |
| 36 | +</head> |
| 37 | +<body> |
| 38 | + <h1>Page Moved</h1> |
| 39 | + <div class="redirect-message"> |
| 40 | + <p>This page has moved to a new location.</p> |
| 41 | + <div class="spinner"></div> |
| 42 | + <p>Redirecting you automatically...</p> |
| 43 | + <p><small>If you are not redirected automatically, <a href="/" id="fallback-link">click here to go to the homepage</a>.</small></p> |
| 44 | + </div> |
| 45 | + |
| 46 | + <script> |
| 47 | + // Redirect mapping from Jekyll URLs (with trailing slash) to Astro URLs (without trailing slash) |
| 48 | + const redirectMap = { |
| 49 | + '/about/': '/about', |
| 50 | + '/configs/': '/configs', |
| 51 | + '/html2rss-configs/': '/html2rss-configs', |
| 52 | + '/get-involved/contributing/': '/get-involved/contributing', |
| 53 | + '/get-involved/discussions/': '/get-involved/discussions', |
| 54 | + '/get-involved/issues-and-features/': '/get-involved/issues-and-features', |
| 55 | + '/get-involved/sponsoring/': '/get-involved/sponsoring', |
| 56 | + '/ruby-gem/how-to/advanced-content-extraction/': '/ruby-gem/how-to/advanced-content-extraction', |
| 57 | + '/ruby-gem/how-to/custom-http-requests/': '/ruby-gem/how-to/custom-http-requests', |
| 58 | + '/ruby-gem/how-to/dynamic-parameters/': '/ruby-gem/how-to/dynamic-parameters', |
| 59 | + '/ruby-gem/how-to/handling-dynamic-content/': '/ruby-gem/how-to/handling-dynamic-content', |
| 60 | + '/ruby-gem/how-to/managing-feed-configs/': '/ruby-gem/how-to/managing-feed-configs', |
| 61 | + '/ruby-gem/how-to/scraping-json/': '/ruby-gem/how-to/scraping-json', |
| 62 | + '/ruby-gem/how-to/styling-rss-feed/': '/ruby-gem/how-to/styling-rss-feed', |
| 63 | + '/ruby-gem/reference/auto-source/': '/ruby-gem/reference/auto-source', |
| 64 | + '/ruby-gem/reference/channel/': '/ruby-gem/reference/channel', |
| 65 | + '/ruby-gem/reference/cli-reference/': '/ruby-gem/reference/cli-reference', |
| 66 | + '/ruby-gem/reference/headers/': '/ruby-gem/reference/headers', |
| 67 | + '/ruby-gem/reference/strategy/': '/ruby-gem/reference/strategy', |
| 68 | + '/ruby-gem/reference/stylesheets/': '/ruby-gem/reference/stylesheets', |
| 69 | + '/web-application/reference/versioning-and-releases/': '/web-application/reference/versioning-and-releases' |
| 70 | + }; |
| 71 | + |
| 72 | + // Get the current path |
| 73 | + const currentPath = window.location.pathname; |
| 74 | + |
| 75 | + // Check if we have a specific redirect for this path |
| 76 | + if (redirectMap[currentPath]) { |
| 77 | + // Redirect to the new URL |
| 78 | + window.location.replace(redirectMap[currentPath]); |
| 79 | + } else if (currentPath.endsWith('/') && currentPath !== '/') { |
| 80 | + // Generic redirect: remove trailing slash |
| 81 | + const newPath = currentPath.slice(0, -1); |
| 82 | + window.location.replace(newPath); |
| 83 | + } else { |
| 84 | + // No redirect found, go to homepage |
| 85 | + document.getElementById('fallback-link').href = '/'; |
| 86 | + document.querySelector('.redirect-message p').textContent = 'This page could not be found.'; |
| 87 | + document.querySelector('.redirect-message p:nth-child(2)').textContent = 'Redirecting you to the homepage...'; |
| 88 | + setTimeout(() => { |
| 89 | + window.location.replace('/'); |
| 90 | + }, 2000); |
| 91 | + } |
| 92 | + </script> |
| 93 | +</body> |
| 94 | +</html> |
0 commit comments