Skip to content

Commit 0ad7043

Browse files
pytorchbotsvekars
andauthored
Update doc-build.yml (#3071) (#3099)
Summary: Move noindex logic to the build job Pull Request resolved: #3071 Reviewed By: clee2000 Differential Revision: D56218857 Pulled By: svekars fbshipit-source-id: 69dff489d98eee046d69185a6c03d62fbae37a16 (cherry picked from commit 5d7949d) Co-authored-by: Svetlana Karslioglu <[email protected]>
1 parent 59fa8e3 commit 0ad7043

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/doc-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ jobs:
6868
make html
6969
cd ..
7070
71+
# If it's main branch, add noindex tag to all .html files to exclude from Google Search indexing.
72+
GITHUB_REF=${{ github.ref }}
73+
echo "GitHub Ref: ${GITHUB_REF}"
74+
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
75+
find docs/_build/html/ -name "*.html" -print0 | xargs -0 sed -i '/<head>/a \ \ <meta name="robots" content="noindex">';
76+
fi
77+
7178
cp -rf docs/_build/html/* "${RUNNER_DOCS_DIR}"
7279
7380
mv docs/_build/html "${RUNNER_ARTIFACT_DIR}"

0 commit comments

Comments
 (0)