Skip to content

Commit 3f702b7

Browse files
committed
feat(config): Add .hintrc for HTML compatibility hints and update 404.html for improved SPA redirect handling
1 parent eaecb87 commit 3f702b7

File tree

3 files changed

+143
-148
lines changed

3 files changed

+143
-148
lines changed

.hintrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": [
3+
"development"
4+
],
5+
"browserslist": [
6+
"defaults",
7+
"not ie 11",
8+
"not and_ff <= 130",
9+
"not firefox <= 130",
10+
"not opera <= 113"
11+
],
12+
"hints": {
13+
"compat-api/html": [
14+
"default",
15+
{
16+
"ignore": [
17+
"meta[name=theme-color]"
18+
]
19+
}
20+
]
21+
}
22+
}

index.html

Lines changed: 79 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,89 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
77

8-
<!-- Theme and appearance -->
9-
<meta name="theme-color" content="#E4093E" />
10-
<meta name="msapplication-navbutton-color" content="#E4093E" />
11-
<meta name="apple-mobile-web-app-capable" content="yes" />
12-
<meta
13-
name="apple-mobile-web-app-status-bar-style"
14-
content="black-translucent"
15-
/>
16-
<meta name="msapplication-TileColor" content="#E4093E" />
8+
<!-- Theme and appearance -->
9+
<meta name="theme-color" content="#E4093E" />
10+
<meta name="msapplication-navbutton-color" content="#E4093E" />
11+
<meta name="apple-mobile-web-app-capable" content="yes" />
12+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
13+
<meta name="msapplication-TileColor" content="#E4093E" />
1714

18-
<!-- SEO Meta Tags -->
19-
<title>ThinkRED Technologies | Simplify Technology & Experience</title>
20-
<meta
21-
name="description"
22-
content="ThinkRED Technologies - We build cutting-edge web applications, platforms, and infrastructure solutions that transform businesses and delight users."
23-
/>
24-
<meta
25-
name="keywords"
26-
content="ThinkRED, Technology, Web Applications, Platforms, Infrastructure Solutions, DevOps, Cloud Computing, React, TypeScript"
27-
/>
28-
<meta name="author" content="ThinkRED Technologies" />
29-
<meta name="robots" content="index, follow" />
15+
<!-- SEO Meta Tags -->
16+
<title>ThinkRED Technologies | Simplify Technology & Experience</title>
17+
<meta name="description" content="ThinkRED Technologies - We build cutting-edge web applications, platforms, and infrastructure solutions that transform businesses and delight users." />
18+
<meta name="keywords" content="ThinkRED, Technology, Web Applications, Platforms, Infrastructure Solutions, DevOps, Cloud Computing, React, TypeScript" />
19+
<meta name="author" content="ThinkRED Technologies" />
20+
<meta name="robots" content="index, follow" />
3021

31-
<!-- Open Graph / Facebook -->
32-
<meta
33-
property="og:title"
34-
content="ThinkRED Technologies | Simplify Technology & Experience"
35-
/>
36-
<meta
37-
property="og:description"
38-
content="ThinkRED Technologies - We build cutting-edge web applications, platforms, and infrastructure solutions that transform businesses and delight users."
39-
/>
40-
<meta property="og:image" content="/assets/images/thinkRED-np.svg" />
41-
<meta property="og:url" content="https://thinkredtech.github.io" />
42-
<meta property="og:type" content="website" />
22+
<!-- Open Graph / Facebook -->
23+
<meta property="og:title" content="ThinkRED Technologies | Simplify Technology & Experience" />
24+
<meta property="og:description" content="ThinkRED Technologies - We build cutting-edge web applications, platforms, and infrastructure solutions that transform businesses and delight users." />
25+
<meta property="og:image" content="/assets/images/thinkRED-np.svg" />
26+
<meta property="og:url" content="https://thinkredtech.github.io" />
27+
<meta property="og:type" content="website" />
4328

44-
<!-- Twitter -->
45-
<meta name="twitter:card" content="summary_large_image" />
46-
<meta
47-
name="twitter:title"
48-
content="ThinkRED Technologies | Simplify Technology & Experience"
49-
/>
50-
<meta
51-
name="twitter:description"
52-
content="ThinkRED Technologies - We build cutting-edge web applications, platforms, and infrastructure solutions that transform businesses and delight users."
53-
/>
54-
<meta name="twitter:image" content="/assets/images/thinkRED-np.svg" />
29+
<!-- Twitter -->
30+
<meta name="twitter:card" content="summary_large_image" />
31+
<meta name="twitter:title" content="ThinkRED Technologies | Simplify Technology & Experience" />
32+
<meta name="twitter:description" content="ThinkRED Technologies - We build cutting-edge web applications, platforms, and infrastructure solutions that transform businesses and delight users." />
33+
<meta name="twitter:image" content="/assets/images/thinkRED-np.svg" />
5534

56-
<!-- Icons -->
57-
<link rel="icon" href="/favicon.ico" />
58-
<link
59-
rel="apple-touch-icon"
60-
href="/assets/images/thinkred/apple-touch-icon.png"
61-
/>
62-
<link rel="manifest" href="/manifest.json" />
35+
<!-- Icons -->
36+
<link rel="icon" href="/favicon.ico" />
37+
<link rel="apple-touch-icon" href="/assets/images/thinkred/apple-touch-icon.png" />
38+
<link rel="manifest" href="/manifest.json" />
6339

64-
<!-- Fonts -->
65-
<link
66-
href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&family=Montserrat:wght@300;400;500;600;700&display=swap"
67-
rel="stylesheet"
68-
/>
40+
<!-- Fonts -->
41+
<link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&family=Montserrat:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
6942

70-
<!-- GitHub Pages SPA redirect handling -->
71-
<script type="text/javascript">
72-
// Handle GitHub Pages SPA routing
73-
(function (l) {
74-
if (l.search[1] === '/') {
75-
var decoded = l.search
76-
.slice(1)
77-
.split('&')
78-
.map(function (s) {
79-
return s.replace(/~and~/g, '&');
80-
})
81-
.join('?');
82-
window.history.replaceState(
83-
null,
84-
null,
85-
l.pathname.slice(0, -1) + decoded + l.hash
86-
);
87-
}
88-
})(window.location);
89-
</script>
90-
</head>
91-
<body>
92-
<noscript>
93-
<div
94-
style="
95-
display: flex;
96-
flex-direction: column;
97-
align-items: center;
98-
justify-content: center;
99-
height: 100vh;
100-
text-align: center;
101-
font-family: Arial, sans-serif;
102-
background-color: #f5f5f5;
103-
color: #333;
104-
"
105-
>
106-
<h1>JavaScript Required</h1>
107-
<p>
108-
This website requires JavaScript to function properly. Please enable
109-
JavaScript in your browser and refresh the page.
110-
</p>
111-
</div>
112-
</noscript>
113-
<div id="root"></div>
114-
<script type="module" src="/src/index.tsx"></script>
115-
</body>
43+
<!-- GitHub Pages SPA redirect handling -->
44+
<script type="text/javascript">
45+
// Handle GitHub Pages SPA routing
46+
(function (l) {
47+
if (l.search[1] === '/') {
48+
var decoded = l.search
49+
.slice(1)
50+
.split('&')
51+
.map(function (s) {
52+
return s.replace(/~and~/g, '&');
53+
})
54+
.join('?');
55+
window.history.replaceState(
56+
null,
57+
null,
58+
l.pathname.slice(0, -1) + decoded + l.hash
59+
);
60+
}
61+
})(window.location);
62+
</script>
63+
</head>
64+
<body>
65+
<noscript>
66+
<div
67+
style="
68+
display: flex;
69+
flex-direction: column;
70+
align-items: center;
71+
justify-content: center;
72+
height: 100vh;
73+
text-align: center;
74+
font-family: Arial, sans-serif;
75+
background-color: #f5f5f5;
76+
color: #333;
77+
"
78+
>
79+
<h1>JavaScript Required</h1>
80+
<p>
81+
This website requires JavaScript to function properly. Please enable
82+
JavaScript in your browser and refresh the page.
83+
</p>
84+
</div>
85+
</noscript>
86+
<div id="root"></div>
87+
<script type="module" src="/src/index.tsx"></script>
88+
</body>
11689
</html>

public/404.html

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<title>ThinkRED Technologies</title>
6-
<script type="text/javascript">
7-
// GitHub Pages SPA redirect script
8-
// This script takes the current URL and redirects to the root with the path as a query parameter
9-
// which can be handled by the React app for client-side routing
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>ThinkRED Technologies</title>
7+
<link rel="stylesheet" href="404.css" />
8+
<script type="text/javascript">
9+
// GitHub Pages SPA redirect script
10+
// This script takes the current URL and redirects to the root with the path as a query parameter
11+
// which can be handled by the React app for client-side routing
1012

11-
var pathSegmentsToKeep = 0;
12-
var l = window.location;
13+
var pathSegmentsToKeep = 0;
14+
var l = window.location;
1315

14-
// For user/org sites (like thinkredtech.github.io), we keep 0 path segments
15-
// For project sites (like username.github.io/project), we would keep 1 segment
16+
// For user/org sites (like thinkredtech.github.io), we keep 0 path segments
17+
// For project sites (like username.github.io/project), we would keep 1 segment
1618

17-
l.replace(
18-
l.protocol +
19-
'//' +
20-
l.hostname +
21-
(l.port ? ':' + l.port : '') +
22-
l.pathname
23-
.split('/')
24-
.slice(0, 1 + pathSegmentsToKeep)
25-
.join('/') +
26-
'/?/' +
27-
l.pathname
28-
.slice(1)
29-
.split('/')
30-
.slice(pathSegmentsToKeep)
31-
.join('/')
32-
.replace(/&/g, '~and~') +
33-
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
34-
l.hash
35-
);
36-
</script>
37-
</head>
38-
<body>
39-
<div
40-
style="text-align: center; padding: 50px; font-family: Arial, sans-serif"
41-
>
42-
<h1>Redirecting...</h1>
43-
<p>
44-
If you are not redirected automatically, <a href="/">click here</a>.
45-
</p>
46-
</div>
47-
</body>
19+
l.replace(
20+
l.protocol +
21+
'//' +
22+
l.hostname +
23+
(l.port ? ':' + l.port : '') +
24+
l.pathname
25+
.split('/')
26+
.slice(0, 1 + pathSegmentsToKeep)
27+
.join('/') +
28+
'/?/' +
29+
l.pathname
30+
.slice(1)
31+
.split('/')
32+
.slice(pathSegmentsToKeep)
33+
.join('/')
34+
.replace(/&/g, '~and~') +
35+
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
36+
l.hash
37+
);
38+
</script>
39+
</head>
40+
<body>
41+
<div class="redirect-container">
42+
<h1>Redirecting...</h1>
43+
<p>
44+
If you are not redirected automatically, <a href="/">click here</a>.
45+
</p>
46+
</div>
47+
</body>
4848
</html>

0 commit comments

Comments
 (0)