pytorch/docs/source/_templates/layout.html
Richard Zou e059fd40a8 Remove master documentation from being indexable by search engines (#58056)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58056

This PR addresses an action item in #3428: disabling search engine
indexing of master documentation. This is desireable because we want to
direct users to our stable documentation (instead of master
documentation) because they are more likely to have a stable version of
PyTorch installed.

Test Plan:
1. run `make html`, check that the noindex tags are there
2. run `make html-stable, check that the noindex tags aren't there

Reviewed By: bdhirsh

Differential Revision: D28490504

Pulled By: zou3519

fbshipit-source-id: 695c944c4962b2bd484dd7a5e298914a37abe787
2021-05-18 06:20:09 -07:00

42 lines
1.2 KiB
HTML

{% extends "!layout.html" %}
<link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html" />
{% block extrahead %}
{% if release == "master" %}
<!--
Search engines should not index the master version of documentation.
Stable documentation are built without release == 'master'.
-->
<meta name="robots" content="noindex">
{% endif %}
{% endblock %}
{% block menu %}
{% if release == "master" %}
<div>
<a style="color:#F05732" href="{{ theme_canonical_url }}{{ pagename }}.html">
You are viewing unstable developer preview docs.
Click here to view docs for latest stable release.
</a>
</div>
{% endif %}
{{ super() }}
{% endblock %}
{% block sidebartitle %}
<div class="version">
<a href='https://pytorch.org/docs/versions.html'>{{ version }} &#x25BC</a>
</div>
{% include "searchbox.html" %}
{% endblock %}
{% block footer %}
{{ super() }}
<script script type="text/javascript">
var collapsedSections = ['Notes', 'Language Bindings', 'Libraries', 'Community'];
</script>
<img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/795629140/?label=txkmCPmdtosBENSssfsC&amp;guid=ON&amp;script=0"/>
{% endblock %}