Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
131 lines (120 loc) · 6.44 KB
/
Copy pathindex.html
File metadata and controls
131 lines (120 loc) · 6.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- No-op <base> (no href, _self is the default target). React Router's
hash history runs querySelector("base") for every <Link> href, which
scans the whole DOM when no <base> exists. -->
<base target="_self" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- color-scheme on :root + html.light/html.dark in index.css pins UA
surfaces (scrollbars etc.) to the in-app theme; this meta opts the UA
into both schemes first. -->
<meta name="color-scheme" content="light dark" />
<!-- HashRouter has no crawlable per-route URLs, so one site-level canonical is correct. -->
<link rel="canonical" href="https://hackertok.github.io/" />
<!-- Primary Meta Tags -->
<title>HackerTok</title>
<meta name="title" content="HackerTok - Your daily dose of Hacker News" />
<meta name="description" content="An open-source, blazingly fast, progressive Hacker News client. Swipe or scroll through stories, read comments, and install as an app." />
<!-- Status-bar / browser-chrome color. Single JS-controlled tag (no media
query) so it tracks the *app* theme, not just the OS scheme. The
bootstrap script below sets the correct value before first paint and
ThemeProvider keeps it in sync on toggle / OS change. Keep these hex
values in sync with THEME_COLORS in src/context/ThemeContext.tsx. -->
<meta name="theme-color" content="#fffdfb" />
<!-- Favicons -->
<link rel="icon" type="image/svg+xml" href="/icons/icon.svg" />
<link rel="icon" type="image/png" sizes="192x192" href="/icons/icon-192.png" />
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
<!-- Web App Manifest -->
<link rel="manifest" href="/manifest.webmanifest" />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:site_name" content="HackerTok" />
<meta property="og:url" content="https://hackertok.github.io/" />
<meta property="og:title" content="HackerTok - Your daily dose of Hacker News" />
<meta property="og:description" content="An open-source, blazingly fast, progressive Hacker News client. Swipe or scroll through stories, read comments, and install as an app." />
<meta property="og:image" content="https://hackertok.github.io/icons/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="HackerTok - Your daily dose of Hacker News" />
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:url" content="https://hackertok.github.io/" />
<meta name="twitter:title" content="HackerTok - Your daily dose of Hacker News" />
<meta name="twitter:description" content="An open-source, blazingly fast, progressive Hacker News client. Swipe or scroll through stories, read comments, and install as an app." />
<meta name="twitter:image" content="https://hackertok.github.io/icons/og-image.png" />
<!-- Minimal WebSite node; its supported use is Google's "site name"
selection (the `name` property). No per-item nodes (hash routes aren't crawlable). -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "HackerTok",
"url": "https://hackertok.github.io/"
}
</script>
<!-- Preconnect to APIs for faster first request -->
<!-- Algolia first: homepage uses it for initial stories -->
<link rel="preconnect" href="https://hn.algolia.com" />
<link rel="dns-prefetch" href="https://hn.algolia.com" />
<!-- Firebase: used for comments and other sections -->
<link rel="preconnect" href="https://hacker-news.firebaseio.com" />
<link rel="dns-prefetch" href="https://hacker-news.firebaseio.com" />
<script>
// Redirect non-hash paths into HashRouter (e.g. /item/123 → /#/item/123)
// Handles: Vite SPA fallback in dev, direct URL entry, shared links without hash
(function() {
var p = window.location.pathname;
if (p !== '/' && p !== '/index.html') {
window.location.replace('/#' + p + window.location.search);
}
})();
</script>
<script>
// Prevent flash of wrong theme, and set the initial status-bar color
// before first paint so the Android PWA chrome matches the resolved theme.
// Mirrors ThemeProvider: 'light'/'dark' are explicit pins; 'system' (and
// any missing value) follows the OS color scheme.
(function() {
// Reading storage throws when the browser blocks site data; follow the OS then.
var mode = null;
try {
mode = localStorage.getItem('setting:theme');
} catch (e) {}
var prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
var isDark = mode === 'dark' || (mode !== 'light' && prefersDark);
if (isDark) {
document.documentElement.classList.add('dark');
}
var meta = document.querySelector('meta[name="theme-color"]');
if (meta) {
meta.setAttribute('content', isDark ? '#241e1a' : '#fffdfb');
}
})();
</script>
</head>
<body class="bg-background text-foreground">
<script>
// Prevent scrollbar flash on mobile (swipe mode hides body overflow).
// React manages the class once hydrated, so this has to reach the same
// verdict useCanSwipe will — hence both of its questions, in its units.
(function() {
var canSwipe = !window.matchMedia('(min-width: 48rem)').matches
&& window.matchMedia('(pointer: coarse) and (hover: none)').matches;
var path = (window.location.hash || '#/').slice(1).split('?')[0];
// Only the routes App.tsx gives a swipe viewer: the class otherwise
// stays on pages that never clear it (404, "Item not found").
var isSwipeRoute = /^\/(?:(?:show|ask|best|newest)\/?|item\/\d+\/?|from\/.+|submitted\/[^\/]+\/?)?$/i.test(path);
if (canSwipe && isSwipeRoute) {
document.documentElement.classList.add('swipe-mode');
document.body.classList.add('swipe-mode');
}
})();
</script>
<noscript>You need to enable JavaScript to run HackerTok.</noscript>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>