|
7 | 7 | <meta name="theme-color" content="#000000" /> |
8 | 8 | <meta |
9 | 9 | name="description" |
10 | | - content="Web site created using create-react-app" |
| 10 | + content="UPenn EcoVenture Challenge - Environmental startup pitch competition" |
11 | 11 | /> |
12 | 12 | <link rel="apple-touch-icon" href="%PUBLIC_URL%/apple-touch-icon.png" /> |
13 | 13 | <!-- |
|
25 | 25 | Learn how to configure a non-root public URL by running `npm run build`. |
26 | 26 | --> |
27 | 27 | <title>UPenn EcoVenture Challenge</title> |
28 | | - <!-- Start Single Page Apps for GitHub Pages --> |
| 28 | + <!-- Simplified script to handle routing for SPA --> |
29 | 29 | <script type="text/javascript"> |
30 | | - // Single Page Apps for GitHub Pages |
31 | | - // MIT License |
32 | | - // https://github.com/rafgraph/spa-github-pages |
33 | | - // This script checks to see if a redirect is present in the query string, |
34 | | - // converts it back into the correct url and adds it to the |
35 | | - // browser's history using window.history.replaceState(...), |
36 | | - // which won't cause the browser to attempt to load the new url. |
37 | | - // When the single page app is loaded further down in this file, |
38 | | - // the correct url will be waiting in the browser's history for |
39 | | - // the single page app to route accordingly. |
40 | | - (function(l) { |
41 | | - if (l.search[1] === '/' ) { |
42 | | - var decoded = l.search.slice(1).split('&').map(function(s) { |
43 | | - return s.replace(/~and~/g, '&') |
44 | | - }).join('?'); |
45 | | - window.history.replaceState(null, null, |
46 | | - l.pathname.slice(0, -1) + decoded + l.hash |
47 | | - ); |
| 30 | + // This is a simplified approach to handle routes on a custom domain |
| 31 | + // No complex path manipulation required when using a custom domain |
| 32 | + |
| 33 | + // If coming from a redirect with a specific path, this will |
| 34 | + // ensure the React Router handles it correctly |
| 35 | + if (window.location.search) { |
| 36 | + try { |
| 37 | + const path = window.location.search.substring(1); |
| 38 | + if (path) { |
| 39 | + window.history.replaceState(null, null, '/' + path); |
| 40 | + } |
| 41 | + } catch (e) { |
| 42 | + console.error('Error handling redirect:', e); |
48 | 43 | } |
49 | | - }(window.location)) |
| 44 | + } |
50 | 45 | </script> |
51 | | - <!-- End Single Page Apps for GitHub Pages --> |
52 | 46 | </head> |
53 | 47 | <body> |
54 | 48 | <noscript>You need to enable JavaScript to run this app.</noscript> |
|
0 commit comments