Просмотр исходного кода

Closes #15664: Restore usage of READTHEDOCS env variable

Jeremy Stretch 1 год назад
Родитель
Сommit
ebe504c825
2 измененных файлов с 3 добавлено и 2 удалено
  1. 2 2
      docs/_theme/main.html
  2. 1 0
      mkdocs.yml

+ 2 - 2
docs/_theme/main.html

@@ -2,8 +2,8 @@
 
 
 {% block site_meta %}
 {% block site_meta %}
   {{ super() }}
   {{ super() }}
-  {# Disable search indexing unless we're building for ReadTheDocs (see #10496) #}
-  {% if page.canonical_url != 'https://docs.netbox.dev/' %}
+  {# Disable search indexing unless we're building for ReadTheDocs #}
+  {% if not config.extra.readthedocs %}
     <meta name="robots" content="noindex">
     <meta name="robots" content="noindex">
   {% endif %}
   {% endif %}
 {% endblock %}
 {% endblock %}

+ 1 - 0
mkdocs.yml

@@ -42,6 +42,7 @@ plugins:
             show_root_toc_entry: false
             show_root_toc_entry: false
             show_source: false
             show_source: false
 extra:
 extra:
+  readthedocs: !ENV READTHEDOCS
   social:
   social:
     - icon: fontawesome/brands/github
     - icon: fontawesome/brands/github
       link: https://github.com/netbox-community/netbox
       link: https://github.com/netbox-community/netbox