Skip to content

Commit 55d0214

Browse files
committed
Generate static sitemap.txt in CI
This will be linked to by the root macvim.org's robots.txt, to help web crawlers go through the documentation pages.
1 parent 8ffcb46 commit 55d0214

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ jobs:
8484
cd vimhelp
8585
python3 scripts/h2h.py -i "$MACVIM_DIR/runtime/doc" -o ../build --project macvim --web-version --output-tags-json --version "$version_string" --commit "$MACVIM_COMMIT"
8686
87+
- name: Generate sitemap
88+
run: |
89+
cd build
90+
${GITHUB_WORKSPACE}/scripts/generate_sitemap > sitemap.txt
91+
8792
- name: Upload page artifact
8893
uses: actions/upload-pages-artifact@v1
8994
with:

scripts/generate_sitemap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -e -o pipefail
4+
5+
# Simple script to generate a simple text-based sitemap. Don't use XML since
6+
# it's kind of overkill for a simple site with lots of static HTML pages.
7+
# We also exclude the redirect.html since it's not really useful to crawl.
8+
echo "https://macvim.org/docs/"
9+
for f in *.html; do
10+
if [[ "$f" != "redirect.html" ]]; then
11+
echo "https://macvim.org/docs/$f"
12+
fi
13+
done

0 commit comments

Comments
 (0)