-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
42 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,46 @@ | ||
<!-- | ||
Because this site is deployed to GitHub Pages, which doesn't support client-side routing, this file is used to handle the anticipated 404 errors thrown when a user tries to access any page that's not the root. This file forces a redirect to the root path so as to allow react-router-dom to handle routing on the client side... | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Redirecting...</title> | ||
<script type="text/javascript"> | ||
//Function to load the index.html content | ||
function loadIndex() { | ||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', '/index.html', true); | ||
xhr.onreadystatechange = function () { | ||
if (xhr.readyState === 4 && xhr.status === 200) { | ||
document.open(); | ||
document.write(xhr.responseText); | ||
document.close(); | ||
fixRelativePaths(); | ||
<meta charset="UTF-8"> | ||
<title>Redirecting...</title> | ||
<script type="text/javascript"> | ||
const loadIndex = () => { //...define a function to load the index.html content which... | ||
const xhr = new XMLHttpRequest() //...creates a new XMLHttpRequest object... | ||
xhr.open('GET', '/index.html', true) //...opens a new GET request to the index.html file... | ||
xhr.onreadystatechange = () => { //...defines the onreadystatechange event handler wherein... | ||
if (xhr.readyState === 4 && xhr.status === 200) { //...if the request is complete and successful... | ||
document.open() //...opens the document... | ||
document.write(xhr.responseText) //...writes the response text to the document... | ||
document.close() //...closes the document... | ||
fixRelativePaths() //...and calls the fixRelativePaths function to fix relative paths for assets... | ||
} | ||
} | ||
xhr.send() //...and sends the request... | ||
} | ||
}; | ||
xhr.send(); | ||
} | ||
|
||
// Function to fix relative paths for assets | ||
function fixRelativePaths() { | ||
var base = document.createElement('base'); | ||
base.href = '/'; | ||
document.head.appendChild(base); | ||
} | ||
const fixRelativePaths = () => { //...define a function to fix relative paths for assets which... | ||
const base = document.createElement('base') //...creates a new base element... | ||
base.href = '/' //...sets the href attribute to the root path... | ||
document.head.appendChild(base) //...and appends the base element to the head of the document... | ||
} | ||
|
||
// Preserve the original path, query string, and hash | ||
var path = window.location.pathname; | ||
var query = window.location.search; | ||
var hash = window.location.hash; | ||
//...get the current path, query, and hash... | ||
const path = window.location.pathname | ||
const query = window.location.search | ||
const hash = window.location.hash | ||
|
||
// Load the index.html content | ||
loadIndex(); | ||
loadIndex() //...call the loadIndex function to load the index.html content... | ||
|
||
// Update the browser's address bar to the original path | ||
history.replaceState(null, '', path + query + hash); | ||
</script> | ||
history.replaceState(null, '', path + query + hash) //...and replace the current history state with the root path, query, and hash | ||
</script> | ||
</head> | ||
<body> | ||
<!-- | ||
...The body is intentionally left empty as the user will be redirected immediately | ||
--> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="description" content="David Homyk | Music | React.js | Projects | Resume | GitHub | NPM | Contact"><meta name="keywords" content="David Homyk, Music, React.js, Projects, Resume, GitHub, NPM, Contact"><meta name="author" content="David Homyk"><link rel="icon" href="./favicon.ico"/><link rel="apple-touch-icon" href="logo192.png"/><link rel="stylesheet" href="/styles.css"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/><meta name="theme-color" content="rgb(1, 1, 20)"/><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"/><link rel="stylesheet" href="https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fontisto@v3.0.4/css/fontisto/fontisto.min.css"><link href="https://fonts.googleapis.com/css?family=Cormorant+Garamond|Nothing+You+Could+Do&display=swap" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/@mediapipe/camera_utils/camera_utils.js" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/@mediapipe/control_utils/control_utils.js" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/@mediapipe/drawing_utils/drawing_utils.js" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands/hands.js" crossorigin="anonymous"></script><link rel="manifest" href="./manifest.json"/><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/emailjs-com@2.3.2/dist/email.min.js"></script><script type="text/javascript">emailjs.init("user_cqWwBjugzaX0BXZjXbz8a")</script><title>David Homyk | Music | React.js | Projects | Resume | GitHub | NPM | Contact</title><script defer="defer" src="./static/js/main.709ce480.js"></script><link href="./static/css/main.d1a28e66.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="description" content="David Homyk | Music | React.js | Projects | Resume | GitHub | NPM | Contact"><meta name="keywords" content="David Homyk, Music, React.js, Projects, Resume, GitHub, NPM, Contact"><meta name="author" content="David Homyk"><link rel="icon" href="./favicon.ico"/><link rel="apple-touch-icon" href="logo192.png"/><link rel="stylesheet" href="/styles.css"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/><meta name="theme-color" content="rgb(1, 1, 20)"/><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"/><link rel="stylesheet" href="https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fontisto@v3.0.4/css/fontisto/fontisto.min.css"><link href="https://fonts.googleapis.com/css?family=Cormorant+Garamond|Nothing+You+Could+Do&display=swap" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/@mediapipe/camera_utils/camera_utils.js" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/@mediapipe/control_utils/control_utils.js" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/@mediapipe/drawing_utils/drawing_utils.js" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands/hands.js" crossorigin="anonymous"></script><link rel="manifest" href="./manifest.json"/><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/emailjs-com@2.3.2/dist/email.min.js"></script><script type="text/javascript">emailjs.init("user_cqWwBjugzaX0BXZjXbz8a")</script><title>David Homyk | Music | React.js | Projects | Resume | GitHub | NPM | Contact</title><script defer="defer" src="./static/js/main.ce91e151.js"></script><link href="./static/css/main.d1a28e66.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.