DocScoDoc/tools/publish
2022-10-29 09:16:14 +02:00

35 lines
600 B
Bash
Executable File

#!/bin/bash
# Compile and publish to web
if [ ! -e "./docs" ]
then
echo "Wrong current directory: should be launched from DocScoDoc as"
echo " tools/publish"
fi
# --- Build
if [ "$1" = "-b" ]
then
if ! command -v mkdocs &> /dev/null
then
echo "Please active mkdocs :"
echo " source venv/bin/activate"
exit 1
fi
mkdocs build
fi
# Generate robots.txt
cat > site/robots.txt <<EOF
User-agent: *
Allow: /
Sitemap: http://scodoc.org/sitemap.xml
EOF
(cd site && ln -s img/favicon.ico .)
# --- Publish
rsync -vaze ssh --delete site scodoc.org:/var/www/html