-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
90 lines (75 loc) · 2.98 KB
/
404.html
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
<!-- This file is a fallback for github pages -->
<!-- Basically this will try to load a request to show an article -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>uhhhh what is going on??</title>
<link rel="stylesheet" href="styles/styles.css" />
<link rel="stylesheet" href="styles/code-block-theme.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
rel="stylesheet"
/>
<link
rel="icon"
type="image/x-icon"
href="https://avatars.githubusercontent.com/u/184101638?s=400&u=3238f105f8e0af6291626d1525e83708f158e5e2&v=4"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/python.min.js"></script>
</head>
<body>
<div id="article-header-main">
<h1 id="article-header">definetely some cookery going on</h1>
<div id="article-header-metadata">
<a href="https://eliseydudin.github.io">homepage</a>
<div id="article-date">published nov 3</div>
</div>
</div>
<hr class="divider" />
<div id="article-members"></div>
</body>
<script type="module">
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
const search = window.location.href
.replace("https://eliseydudin.github.io/", "")
.replace("%20", " ");
console.log(search);
fetch(
"https://raw.githubusercontent.com/eliseydudin/github-articles/refs/heads/main/articles-map.json"
)
.then((resp) => resp.text())
.then((text) => {
console.log(text);
const obj = JSON.parse(text);
if (Object.keys(obj).length === 0) {
return;
}
const articles = obj.articles.reverse();
for (let article of articles) {
if (article.title == search) {
return article;
}
}
throw new EvalError("ummm cant find this article :(");
})
.then((data) => {
document.title = data.title;
document.getElementById("article-header").textContent = data.title;
document.getElementById("article-date").textContent = data.date;
return fetch(data.url);
})
.then((data) => data.text())
.then((data) => {
document.getElementById("article-members").innerHTML =
marked.parse(data);
hljs.highlightAll();
})
.catch((error) => console.error("Error fetching articles:", error));
hljs.highlightAll();
</script>
</html>