mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed JavaScript error on home page if Disqus is enabled
This commit is contained in:
parent
e625efdfe9
commit
6ecf71ee8d
@ -159,10 +159,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block disqus %}
|
{% block disqus %}
|
||||||
{% if (config.extra.disqus and not page.is_homepage) or
|
{% include "partials/integrations/disqus.html" %}
|
||||||
(page and page.meta and page.meta.disqus) %}
|
|
||||||
{% include "partials/integrations/disqus.html" %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
# Language for theme localization
|
# Language for theme localization
|
||||||
language: en
|
language: en
|
||||||
|
|
||||||
# Text direction (can be ltr or rtl)
|
# Text direction (can be ltr or rtl), default: ltr
|
||||||
direction:
|
direction:
|
||||||
|
|
||||||
# Feature flags for functionality that alters behavior significantly, and thus
|
# Feature flags for functionality that alters behavior significantly, and thus
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% if page and page.meta and page.meta.disqus is string %}
|
{% if page and page.meta and page.meta.disqus is string %}
|
||||||
{% set disqus = page.meta.disqus %}
|
{% set disqus = page.meta.disqus %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if disqus %}
|
{% if not page.is_homepage and disqus %}
|
||||||
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
||||||
<div id="disqus_thread"></div>
|
<div id="disqus_thread"></div>
|
||||||
<script>
|
<script>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
{% if page and page.meta and page.meta.disqus is string %}
|
{% if page and page.meta and page.meta.disqus is string %}
|
||||||
{% set disqus = page.meta.disqus %}
|
{% set disqus = page.meta.disqus %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if disqus %}
|
{% if not page.is_homepage and disqus %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="#__comments" title="{{ lang.t('meta.comments') }}" class="md-nav__link md-nav__link--active">
|
<a href="#__comments" title="{{ lang.t('meta.comments') }}" class="md-nav__link md-nav__link--active">
|
||||||
{{ lang.t("meta.comments") }}
|
{{ lang.t("meta.comments") }}
|
||||||
|
@ -295,10 +295,7 @@
|
|||||||
|
|
||||||
<!-- Disqus integration -->
|
<!-- Disqus integration -->
|
||||||
{% block disqus %}
|
{% block disqus %}
|
||||||
{% if (config.extra.disqus and not page.is_homepage) or
|
{% include "partials/integrations/disqus.html" %}
|
||||||
(page and page.meta and page.meta.disqus) %}
|
|
||||||
{% include "partials/integrations/disqus.html" %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
# Language for theme localization
|
# Language for theme localization
|
||||||
language: en
|
language: en
|
||||||
|
|
||||||
# Text direction (can be ltr or rtl)
|
# Text direction (can be ltr or rtl), default: ltr
|
||||||
direction:
|
direction:
|
||||||
|
|
||||||
# Feature flags for functionality that alters behavior significantly, and thus
|
# Feature flags for functionality that alters behavior significantly, and thus
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Disqus integration -->
|
<!-- Disqus integration -->
|
||||||
{% if disqus %}
|
{% if not page.is_homepage and disqus %}
|
||||||
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
||||||
<div id="disqus_thread"></div>
|
<div id="disqus_thread"></div>
|
||||||
<script>
|
<script>
|
||||||
|
@ -54,12 +54,14 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Disqus integration -->
|
<!-- Set from config but allow override -->
|
||||||
{% set disqus = config.extra.disqus %}
|
{% set disqus = config.extra.disqus %}
|
||||||
{% if page and page.meta and page.meta.disqus is string %}
|
{% if page and page.meta and page.meta.disqus is string %}
|
||||||
{% set disqus = page.meta.disqus %}
|
{% set disqus = page.meta.disqus %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if disqus %}
|
|
||||||
|
<!-- Disqus integration -->
|
||||||
|
{% if not page.is_homepage and disqus %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
<a href="#__comments" title="{{ lang.t('meta.comments') }}"
|
<a href="#__comments" title="{{ lang.t('meta.comments') }}"
|
||||||
class="md-nav__link md-nav__link--active">
|
class="md-nav__link md-nav__link--active">
|
||||||
|
Loading…
Reference in New Issue
Block a user