layout.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {% extends "!layout.html" -%}
  2. {# Refer to https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html #}
  3. {% block htmltitle -%}
  4. <title>{{ godot_title_prefix }}{{ title|striptags|e }}{{ titlesuffix }}</title>
  5. {% endblock -%}
  6. {% block extrahead -%}
  7. <meta name="doc_version" content="{{ version }}" />
  8. <meta name="doc_is_latest" content="{{ godot_is_latest }}" />
  9. <meta name="doc_pagename" content="{{ pagename }}" />
  10. {% endblock -%}
  11. {% block linktags -%}
  12. <meta name="theme-color" content="#3d8fcc" />
  13. {% if godot_inject_language_links -%}
  14. {% for alternate_lang in godot_docs_supported_languages -%}
  15. {# Convert to ISO 639-1 format, e.g. zh_CN -> zh-cn -#}
  16. {% set alternate_lang_href = alternate_lang.lower().replace("_", "-") -%}
  17. <link rel="alternate" hreflang="{{ alternate_lang_href }}" href="{{ godot_docs_basepath }}{{ alternate_lang }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
  18. {% endfor -%}
  19. <link rel="alternate" hreflang="x-default" href="{{ godot_docs_basepath }}{{ godot_default_lang }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
  20. <link rel="canonical" href="{{ godot_docs_basepath }}{{ lang_attr }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
  21. {% endif -%}
  22. {{ super() }}
  23. {% endblock -%}
  24. {%- block document %}
  25. <div itemprop="articleBody">
  26. {% if godot_is_latest or godot_show_article_status %}
  27. <div class="admonition-grid">
  28. {% if godot_is_latest %}
  29. <div class="admonition attention latest-notice">
  30. <p class="first admonition-title">Attention: Here be dragons</p>
  31. <p>
  32. This is the <code class="docutils literal notranslate"><span class="pre">latest</span></code>
  33. (unstable) version of this documentation, which may document features
  34. not available in or compatible with released stable versions of Godot.
  35. </p>
  36. <p class="last latest-notice-link">
  37. Checking the stable version of the documentation...
  38. </p>
  39. </div>
  40. {% endif %}
  41. {% if godot_show_article_status and not godot_is_latest %}
  42. <div class="admonition tip article-status">
  43. {% if meta and meta.get('article_outdated') == 'True' %}
  44. <p class="first admonition-title">Work in progress</p>
  45. <p>
  46. The content of this page was not yet updated for Godot
  47. <code class="docutils literal notranslate">{{ godot_version }}</code>
  48. and may be <strong>outdated</strong>. If you know how to improve this page or you can confirm
  49. that it's up to date, feel free to <a href="https://github.com/godotengine/godot-docs">open a pull request</a>.
  50. </p>
  51. {% else %}
  52. <p class="first admonition-title">Up to date</p>
  53. <p>
  54. This page is <strong>up to date</strong> for Godot <code class="docutils literal notranslate">{{ godot_version }}</code>.
  55. If you still find outdated information, please <a href="https://github.com/godotengine/godot-docs">open an issue</a>.
  56. </p>
  57. {% endif %}
  58. </div>
  59. {% endif %}
  60. </div>
  61. {% endif %}
  62. {% block body %}{% endblock %}
  63. {% if (not meta or meta.get('allow_comments') != 'False') and godot_show_article_comments %}
  64. <div id="godot-giscus">
  65. <hr>
  66. <h2>User-contributed notes</h2>
  67. <p>
  68. <em>Please read the <a href="https://github.com/godotengine/godot-docs-user-notes/discussions/1">User-contributed notes policy</a> before submitting a comment.</em>
  69. </p>
  70. </div>
  71. {% endif %}
  72. {%- if self.comments()|trim %}
  73. <div class="articleComments">
  74. {%- block comments %}{% endblock %}
  75. </div>
  76. {%- endif%}
  77. </div>
  78. {%- endblock %}