Skip to content

Commit

Permalink
Exclude specific-version docs from search engines (#8016)
Browse files Browse the repository at this point in the history
  • Loading branch information
itaigilo authored Aug 5, 2024
1 parent 7fdb5c2 commit d40b90b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docs-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions docs/_config.version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
robots_exclude_from_indexes: true
3 changes: 3 additions & 0 deletions docs/_includes/head_custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KTZBZW9');</script>
<!-- End Google Tag Manager Head -->
{% if site.robots_exclude_from_indexes %}
<meta name="robots" content="noindex">
{% endif %}
<meta property="og:image" content="{{ site.baseurl }}{{ site.image }}">
<link rel="preload" href="/assets/fonts/Rene Bieder - Galano Grotesque.otf" as="font" type="font/otf" crossorigin>
<link rel="preload" href="/assets/fonts/Rene Bieder - Galano Grotesque Medium.otf" as="font" type="font/otf" crossorigin>
Expand Down
4 changes: 4 additions & 0 deletions docs/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d40b90b

Please sign in to comment.