928f52af47
Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D470
36 lines
869 B
Bash
Executable File
36 lines
869 B
Bash
Executable File
#!/bin/bash
|
|
|
|
working_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
# curl and php are required
|
|
if ! which php >/dev/null; then
|
|
echo "php is required!"
|
|
exit 1
|
|
fi
|
|
|
|
cd ${working_dir}
|
|
generator="couscous.phar"
|
|
|
|
# download the generator if it's not already downloaded
|
|
if [ ! -f ${generator} ]; then
|
|
curl -OS http://couscous.io/${generator}
|
|
fi
|
|
|
|
# generate the site
|
|
php ${generator} generate
|
|
|
|
# fix paths in generated files
|
|
cd .couscous/generated
|
|
for i in *; do
|
|
if [ ! -f $i ]; then continue; fi
|
|
sed -i 's@/css/@/docs/css/@g' $i
|
|
sed -i 's@/fonts/@/docs/fonts/@g' $i
|
|
sed -r 's@(<small class="hidden-xs hidden-sm">)@<small class="hidden-xs hidden-sm">Alpha</small></a>\n<a class="navbar-brand" href="/docs/">\1@' -i $i
|
|
done
|
|
|
|
# create archive
|
|
target=docs.tar.gz
|
|
tar -czf $working_dir/$target *
|
|
|
|
echo "Created archive: $working_dir/$target"
|