mirror of
https://github.com/kernc/backtesting.py.git
synced 2024-01-28 15:29:30 +03:00
MNT: Add sitemap.txt generation for gh-pages
This commit is contained in:
11
.github/deploy-gh-pages.sh
vendored
11
.github/deploy-gh-pages.sh
vendored
@@ -8,12 +8,23 @@ fi
|
|||||||
|
|
||||||
[ "$GH_PASSWORD" ] || exit 12
|
[ "$GH_PASSWORD" ] || exit 12
|
||||||
|
|
||||||
|
sitemap() {
|
||||||
|
WEBSITE='https://kernc.github.io/backtesting.py'
|
||||||
|
find -name '*.html' |
|
||||||
|
sed "s,^\.,$WEBSITE," |
|
||||||
|
sed 's/index.html$//' |
|
||||||
|
grep -v '/google.*\.html$' |
|
||||||
|
sort -u > 'sitemap.txt'
|
||||||
|
echo "Sitemap: $WEBSITE/sitemap.txt" > 'robots.txt'
|
||||||
|
}
|
||||||
|
|
||||||
head=$(git rev-parse HEAD)
|
head=$(git rev-parse HEAD)
|
||||||
|
|
||||||
git clone -b gh-pages "https://kernc:$GH_PASSWORD@github.com/$TRAVIS_REPO_SLUG.git" gh-pages
|
git clone -b gh-pages "https://kernc:$GH_PASSWORD@github.com/$TRAVIS_REPO_SLUG.git" gh-pages
|
||||||
mkdir -p gh-pages/doc
|
mkdir -p gh-pages/doc
|
||||||
cp -R doc/build/* gh-pages/doc/
|
cp -R doc/build/* gh-pages/doc/
|
||||||
cd gh-pages
|
cd gh-pages
|
||||||
|
sitemap
|
||||||
git add *
|
git add *
|
||||||
git diff --staged --quiet && echo "$0: No changes to commit." && exit 0
|
git diff --staged --quiet && echo "$0: No changes to commit." && exit 0
|
||||||
git commit -a -m "CI: Update docs for $TRAVIS_TAG ($head)"
|
git commit -a -m "CI: Update docs for $TRAVIS_TAG ($head)"
|
||||||
|
|||||||
Reference in New Issue
Block a user