Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/sphinxbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,23 @@ jobs:
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Strip noindex from stable docs
run: |
# Strip noindex from stable docs – these are the canonical pages we want indexed
if [ -d server/stable ]; then
find server/stable -name '*.html' -print0 | \
xargs -0 perl -pi -e 's{<meta name="robots" content="noindex, follow" />\n?}{}g'
fi

- name: Write robots.txt
run: |
cat > robots.txt << 'EOF'
User-agent: *
# Only the stable version should be indexed
Allow: /server/stable/
Disallow: /server/
EOF

# Remove the stage/ directory BEFORE creating the PR so it doesn't get committed
- name: Clean up staging cache before commit
run: rm -rf stage/
Expand Down
5 changes: 5 additions & 0 deletions _shared_assets/templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "!layout.html" %}
{% block extrahead %}
{{ super() }}
<meta name="robots" content="noindex, follow" />
{% endblock %}
Loading