This repository was archived by the owner on Aug 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBakefile.sh
More file actions
53 lines (49 loc) · 1.25 KB
/
Bakefile.sh
File metadata and controls
53 lines (49 loc) · 1.25 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
# shellcheck shell=bash
task.prettier() {
./node_modules/.bin/prettier --write .
}
task.generate() {
local -a dirs=(
''
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
posts/semantic-hotkeys
posts/umpire-method
)
for dir in "${dirs[@]}"; do
if [ -z "$dir" ]; then
route='posts'
else
route=$dir
fi
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://edwinkofler.com/$route/" />
<meta http-equiv="refresh" content="0; url=https://edwinkofler.com/$route/" />
<title>Redirecting...</title>
<script>
window.location.href = 'https://edwinkofler.com/$route/'
</script>
</head>
<body>
<p>
If you are not redirected automatically, click
<a href="https://edwinkofler.com/$route/">here</a>
</p>
</body>
</html>
EOF
done
}