-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert.sh
executable file
·78 lines (63 loc) · 1.93 KB
/
convert.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
set -euxo pipefail
rm -rf public
mkdir -p public
for file in src/*.md; do
outFile="public/$(basename "$file" .md).html"
pandoc --standalone \
--from markdown \
--to html \
--template .pandoc/templates/uikit.html \
--css css/styles.css \
--toc \
--toc-depth=3 \
--shift-heading-level-by=-1 \
--fail-if-warnings \
--metadata title="kingu.dev" \
"$file" >"$outFile"
done
for file in src/apps/**/*.md; do
# src/apps/hoge/index.md → public/apps/hoge/index.html
outFile="$(dirname "$file" | sed 's/src/public/')/index.html"
mkdir -p "$(dirname "$outFile")"
pandoc --standalone \
--from markdown \
--to html \
--template .pandoc/templates/uikit_apps.html \
--css ../../css/styles.css \
--toc \
--toc-depth=3 \
--shift-heading-level-by=-1 \
--fail-if-warnings \
"$file" >"$outFile"
done
for file in src/privacy_policy/*.md src/terms_of_service/*.md; do
# src/apps/hoge/index.md → public/apps/hoge/index.html
outFile="$(dirname "$file" | sed 's/src/public/')/index.html"
mkdir -p "$(dirname "$outFile")"
pandoc --standalone \
--from markdown \
--to html \
"$file" >"$outFile"
done
for file in src/technology-stack/*.md; do
# src/apps/hoge/index.md → public/apps/hoge/index.html
outFile="$(dirname "$file" | sed 's/src/public/')/index.html"
mkdir -p "$(dirname "$outFile")"
pandoc --standalone \
--from markdown \
--to html \
--template .pandoc/templates/uikit.html \
--css ../css/styles.css \
--toc \
--toc-depth=3 \
--shift-heading-level-by=-1 \
--fail-if-warnings \
--metadata title="kingu.dev" \
"$file" >"$outFile"
done
rm -rf public/images
cp -R src/images public/
rm -rf public/css
cp -R src/css public/
cp src/app-ads.txt public/