DocScoDoc/tools/publish

35 lines
600 B
Plaintext
Raw Permalink Normal View History

2020-09-26 14:36:00 +02:00
#!/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
2022-10-29 09:16:14 +02:00
if ! command -v mkdocs &> /dev/null
2020-09-26 14:36:00 +02:00
then
echo "Please active mkdocs :"
2022-10-29 09:16:14 +02:00
echo " source venv/bin/activate"
2020-09-26 14:36:00 +02:00
exit 1
fi
mkdocs build
fi
2021-04-25 21:43:21 +02:00
# 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 .)
2020-09-26 14:36:00 +02:00
# --- Publish
2022-02-27 09:28:16 +01:00
rsync -vaze ssh --delete site scodoc.org:/var/www/html