-
Notifications
You must be signed in to change notification settings - Fork 4
/
build
executable file
·32 lines (28 loc) · 922 Bytes
/
build
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
#!/bin/bash -e
if [ ! -e "node_modules/thumbsup" ]; then
echo "Please install thumbsup first" && exit 1
fi
function make_gallery {
theme=$1
echo "Building theme: ${theme}"
echo ""
# remove albums and mosaics
find docs -depth 1 \( -name *.html -or -name *.png \) -exec rm {} \;
# rebuild using chosen theme
./node_modules/.bin/thumbsup --config config/${theme}.json
# move albums into the themes folder
rm -rf docs/themes/${theme}
mkdir -p docs/themes/${theme}
mv docs/public docs/themes/${theme}/
mv docs/albums docs/themes/${theme}/ 2>/dev/null || true
find docs -depth 1 \( -name *.html -or -name *.png \) -exec mv {} docs/themes/${theme}/ \;
# create symlinks
pushd docs/themes/${theme} > /dev/null
ln -sf ../../media media
popd > /dev/null
}
# generate all samples galleries
# with different themes and settings
make_gallery 'classic'
make_gallery 'cards'
make_gallery 'mosaic'