diff --git a/.github/workflows/docs-release.yaml b/.github/workflows/docs-release.yaml index d8c16098fea..90b00c6f339 100644 --- a/.github/workflows/docs-release.yaml +++ b/.github/workflows/docs-release.yaml @@ -35,7 +35,7 @@ jobs: - name: Build release working-directory: docs - run: bundle exec jekyll build --config _config.yml -d _site/${{ steps.version.outputs.tag }} -b /${{ steps.version.outputs.tag }} + run: bundle exec jekyll build --config _config.yml,_config.version.yml -d _site/${{ steps.version.outputs.tag }} -b /${{ steps.version.outputs.tag }} - name: Remove robots.txt working-directory: docs/_site/${{ steps.version.outputs.tag }} diff --git a/docs/_config.version.yml b/docs/_config.version.yml new file mode 100644 index 00000000000..2a172306aff --- /dev/null +++ b/docs/_config.version.yml @@ -0,0 +1 @@ +robots_exclude_from_indexes: true diff --git a/docs/_includes/head_custom.html b/docs/_includes/head_custom.html index 53697c54627..e63bd2134f8 100644 --- a/docs/_includes/head_custom.html +++ b/docs/_includes/head_custom.html @@ -6,6 +6,9 @@ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KTZBZW9'); +{% if site.robots_exclude_from_indexes %} + +{% endif %} diff --git a/docs/robots.txt b/docs/robots.txt index 29c5cff9073..d0304c7231c 100644 --- a/docs/robots.txt +++ b/docs/robots.txt @@ -3,4 +3,8 @@ layout: null sitemap: false --- User-agent: * +# blocking older versions of the API. +# note: this prevents direct indexing and access, but these pages are still available via refs from other sites. +Disallow: /v0.* +Disallow: /v1.* Sitemap: {{ site.url }}{{ site.baseurl }}/sitemap.xml