base.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {% load i18n static misago_absoluteurl misago_json %}
  2. <!DOCTYPE html>
  3. <html lang="{{ LANGUAGE_CODE_SHORT }}">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width,initial-scale=1">
  8. <title>{% spaceless %}{% block title %}{{ settings.forum_name }}{% endblock %}{% endspaceless %}</title>
  9. <meta name="description" content="{% spaceless %}{% block meta-description %}{% endblock %}{% endspaceless %}">
  10. {% spaceless %}
  11. {% block meta-extra %}{% endblock meta-extra %}
  12. {% block og-tags %}
  13. <meta property="og:site_name" content="{% spaceless %}{% block og-site-name %}{{ settings.forum_name }}{% endblock og-site-name %}{% endspaceless %}" />
  14. <meta name="twitter:card" content="summary" />
  15. <meta property="og:title" content="{% spaceless %}{% block og-title %}{% endblock og-title %}{% endspaceless %}" />
  16. <meta name="twitter:title" content="{% spaceless %}{% block twitter-title %}{% endblock twitter-title %}{% endspaceless %}" />
  17. <meta property="og:description" content="{% spaceless %}{% block og-description %}{{ settings.forum_index_meta_description|default:'' }}{% endblock og-description %}{% endspaceless %}" />
  18. <meta name="twitter:description" content="{% spaceless %}{% block twitter-description %}{{ settings.forum_index_meta_description|default:'' }}{% endblock twitter-description %}{% endspaceless %}" />
  19. <meta property="og:type" content="website" />
  20. <meta property="og:url" content="{% spaceless %}{% block og-url %}{{ settings.forum_address }}{% endblock og-url %}{% endspaceless %}" />
  21. <meta name="twitter:url" content="{% spaceless %}{% block twitter-url %}{{ settings.forum_address }}{% endblock twitter-url %}{% endspaceless %}" />
  22. {% block og-image %}
  23. {% if og_image %}
  24. <meta name="twitter:image" content="{% absoluteurl og_image.url %}" />
  25. <meta property="og:image" content="{% absoluteurl og_image.url %}" />
  26. <meta property="og:image:width" content="{{ og_image.width }}" />
  27. <meta property="og:image:height" content="{{ og_image.height }}" />
  28. {% else %}
  29. {% static "misago/img/og-image.jpg" as og_image_url %}
  30. <meta name="twitter:image" content="{% absoluteurl og_image_url %}" />
  31. <meta property="og:image" content="{% absoluteurl og_image_url %}" />
  32. <meta property="og:image:width" content="1200" />
  33. <meta property="og:image:height" content="630" />
  34. {% endif %}
  35. {% endblock og-image %}
  36. {% endblock og-tags %}
  37. {% if theme.include_defaults %}
  38. <link href="{% static 'misago/css/misago.css' %}" rel="stylesheet">
  39. {% endif %}
  40. {% for css_url in theme.styles %}
  41. <link href="{{ css_url }}" rel="stylesheet">
  42. {% endfor %}
  43. {% if icons.apple_touch_icon %}
  44. <link rel="apple-touch-icon" sizes="180x180" href="{{ icons.apple_touch_icon }}" />
  45. {% else %}
  46. <link rel="apple-touch-icon" sizes="180x180" href="{% static 'misago/apple-touch-icon.png' %}" />
  47. {% endif %}
  48. {% if icons.favicon_32 %}
  49. <link rel="icon" type="image/png" sizes="32x32" href="{{ icons.favicon_32 }}" />
  50. {% else %}
  51. <link rel="icon" type="image/png" sizes="32x32" href="{% static 'misago/favicon-32.png' %}" />
  52. {% endif %}
  53. {% if icons.favicon_16 %}
  54. <link rel="icon" type="image/png" sizes="16x16" href="{{ icons.favicon_16 }}" />
  55. {% else %}
  56. <link rel="icon" type="image/png" sizes="16x16" href="{% static 'misago/favicon-16.png' %}" />
  57. {% endif %}
  58. {% if icons.favicon %}
  59. <link rel="shortcut icon" href="{{ icons.favicon }}" />
  60. {% else %}
  61. <link rel="shortcut icon" href="{% static 'misago/favicon.ico' %}" />
  62. {% endif %}
  63. {% endspaceless %}
  64. <script type="application/ld+json">{"@context":"http://schema.org","@type":"WebSite","url":"{{ settings.forum_address }}"}</script>
  65. </head>
  66. <body {% if misago_agreement %}class="agreement-overlay-visible"{% endif %}>
  67. {% if settings.google_tracking_id %}
  68. {% include "misago/analytics.html" %}
  69. {% endif %}
  70. <div id="auth-message-mount"></div>
  71. <div id="snackbar-mount"></div>
  72. <div id="misago-container" {% if misago_agreement %}aria-hidden="true"{% endif %}>
  73. {% include "misago/jumbotron.html" %}
  74. {% include "misago/navbar.html" %}
  75. <div id="page-mount">
  76. {% block content %}{% endblock content %}
  77. </div>
  78. {% include "misago/posting.html" %}
  79. {% include "misago/footer.html" %}
  80. </div>
  81. {% include "misago/auth.html" %}
  82. <div class="modal fade" id="modal-mount" tabindex="-1" role="dialog" aria-labelledby="misago-modal-label"></div>
  83. {% if misago_agreement %}
  84. {% include "misago/required_agreement.html" %}
  85. {% endif %}
  86. <script src="{% url 'django-i18n' %}?{{ LANGUAGE_CODE }}"></script>
  87. <script type="text/javascript">
  88. if (!(Object.assign && Array.from)) {
  89. var polyfill = document.createElement('script');
  90. polyfill.src = '{% static "misago/js/es2015.js" %}';
  91. document.getElementsByTagName('head')[0].appendChild(polyfill);
  92. }
  93. </script>
  94. <script src="{% static 'misago/js/vendor.js' %}"></script>
  95. {% if LANGUAGE_CODE != "en-us" and MOMENTJS_LOCALE_URL %}
  96. <script src="{% static MOMENTJS_LOCALE_URL %}"></script>
  97. {% endif %}
  98. <script src="{% static 'misago/js/misago.js' %}"></script>
  99. {% include "misago/scripts.html" %}
  100. <script type="text/javascript">
  101. misago.init({{ frontend_context|as_json }});
  102. </script>
  103. </body>
  104. </html>