blob: 402c5e4f3f5e3a59229553ec7d2f22f40e0942ca (
plain) (
blame)
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
|
#!/bin/bash
mkdir -p showcase
mapfile -d $'\0' icon_files < <(find "output" \
-type f \
-name "*.svg" \
-print0)
icons="[]"
for icon in "${icon_files[@]}"; do
title=$icon
title=${title#output/}
title=${title%.svg}
content=$(cat "$icon" | sed -z 's/\\/\\\\/g;s/\n/\\n/g;s/"/\\"/g')
icons=$(echo "$icons" | jq ". += [ { \
content: \"$content\", \
title: \"$title\", \
} ]")
done
meta_file=$(mktemp)
icons=$(echo "$icons" | jq "sort_by(.title)")
echo "{ icons: $icons }" > "$meta_file"
pandoc "src/showcase/index.md" \
-f markdown \
-t html5 \
--no-highlight \
--template "src/showcase/index.html" \
-o "showcase/index.html" \
--metadata-file "$meta_file"
rm "$meta_file"
|