File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -387,6 +387,7 @@ jobs:
387387 run : |
388388 find "stage/${{ needs.stage-and-check.outputs.branch_name }}" -name '*.html' -print0 | while IFS= read -r -d '' f; do
389389 perl -0pi -e 's{^\s*<link rel="canonical" href="https://docs\.nextcloud\.com/server/[^"]*" />\n}{}m' "$f"
390+ perl -pi -e 's{<meta name="robots" content="noindex, follow" />\n?}{}g' "$f"
390391 done
391392 ls -la stage/*
392393
@@ -504,6 +505,24 @@ jobs:
504505 echo "has_changes=true" >> $GITHUB_OUTPUT
505506 fi
506507
508+ - name : Strip noindex from stable docs
509+ run : |
510+ # Strip noindex from stable docs – these are the canonical pages we want indexed
511+ if [ -d server/stable ]; then
512+ find server/stable -name '*.html' -print0 | \
513+ xargs -0 perl -pi -e 's{<meta name="robots" content="noindex, follow" />\n?}{}g'
514+ fi
515+
516+ - name : Write robots.txt
517+ run : |
518+ cat > robots.txt << 'EOF'
519+ User-agent: *
520+ # Only the stable version should be indexed
521+ Allow: /server/stable/
522+ Disallow: /server/
523+ Sitemap: https://docs.nextcloud.com/sitemap.xml
524+ EOF
525+
507526 # Remove the stage/ directory BEFORE creating the PR so it doesn't get committed
508527 - name : Clean up staging cache before commit
509528 run : rm -rf stage/
Original file line number Diff line number Diff line change 1+ {% extends "!layout.html" %}
2+ {% block extrahead %}
3+ {{ super() }}
4+ < meta name ="robots " content ="noindex, follow " />
5+ {% endblock %}
You can’t perform that action at this time.
0 commit comments