This repository has been archived by the owner on Nov 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBakefile.sh
56 lines (52 loc) · 1.53 KB
/
Bakefile.sh
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
# shellcheck shell=bash
task.format() {
./node_modules/.bin/prettier --write .
}
task.generate() {
local -a pages=(
''
posts/new-blog
posts/render-latex-with-katex-in-hugo-blog
posts/fibonacci-equation-using-pascals-triangle-part-1
posts/fibonacci-equation-using-pascals-triangle-part-2
posts/creating-website-for-robotics-club
posts/front-end-web-dev-a-years-reflection
posts/fiddling-with-ubuntu-server-images
posts/fixing-my-internal-network
posts/terminal-automation-with-expect
new-blog
render-latex-with-katex-in-hugo-blog
fibonacci-equation-using-pascals-triangle-part-1
fibonacci-equation-using-pascals-triangle-part-2
creating-website-for-robotics-club
front-end-web-dev-a-years-reflection
fiddling-with-ubuntu-server-images
fixing-my-internal-network
terminal-automation-with-expect
)
for dir in "${pages[@]}"; do
local route=posts/${dir#posts/}
mkdir -p "./$dir"
cat > "./$dir/index.html" <<EOF
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="canonical" href="https://hyperupcall.github.io/blog/$route" />
<meta http-equiv="refresh" content="0; url=https://hyperupcall.github.io/blog/$route" />
<title>Redirecting...</title>
<script>
window.location.href = 'https://hyperupcall.github.io/blog/$route'
</script>
</head>
<body>
<p>
If you are not redirected automatically, click
<a href="https://hyperupcall.github.io/blog/$route">here</a>
</p>
</body>
</html>
EOF
done
}