feat(aio): dynamically, pre-emptively, add `noindex` (#21992)

These tags are removed when the doc is ready and valid, but this will
allow us to block indexing in the case that the Angular app fails to
bootstrap or load the document for some non-404 reason.

This should get around the problem with hardcoded tags. See
c3fb820473

Closes #21941

PR Close #21992
This commit is contained in:
Pete Bacon Darwin 2018-02-02 16:40:14 +00:00 committed by Alex Rickabaugh
parent 3a86940ca5
commit 5a624fa1be
1 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,14 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="translucent">
<script>
// Dynamically, pre-emptively, add `noindex`, which will be removed when the doc is ready and valid
var tag = document.createElement('meta'); tag.name = 'googlebot'; tag.content = 'noindex';
document.head.appendChild(tag);
tag = document.createElement('meta'); tag.name = 'robots'; tag.content = 'noindex';
document.head.appendChild(tag);
</script>
<!-- Google Analytics -->
<script>
// Note this is a customised version of the GA tracking snippet