Fix: isso comments

This commit is contained in:
Kujiu 2021-01-31 16:09:15 +01:00
parent fe2e34776c
commit 64585c63a3
Signed by: kujiu
GPG key ID: ABBB2CAC6855599F
5 changed files with 44 additions and 39 deletions

View file

@ -2,6 +2,11 @@
Changes
=======
2.0.3 (*2021-01-31*)
====================
- Fix isso comments.
2.0.2 (*2020-07-31*)
====================

View file

@ -28,7 +28,7 @@ with open("README.rst", "r") as fh:
setup(
name="sphinx_nervproject_theme",
version="2.0.2",
version="2.0.3",
url="https://procrastinator.nerv-project.eu/nerv-project/sphinx_nervproject_theme",
license="EUPL 1.2",
author="Kujiu",

View file

@ -5,7 +5,7 @@ from sphinx.environment.collectors import EnvironmentCollector
from sphinx import addnodes
from sphinx.util.osutil import relative_uri
__version__ = (2, 0, 2)
__version__ = (2, 0, 3)
class SimpleTocTreeCollector(EnvironmentCollector):

View file

@ -72,6 +72,9 @@
{%- include "util/linktags.html" %}
{%- block extrahead %} {% endblock %}
{% if feed_path %}
<link rel="alternate" type="application/atom+xml" href="{{ pathto(feed_path, 1) }}/atom.xml" title="{{ feed_title }}"/>
{% endif %}
</head>
<body>
@ -113,6 +116,38 @@
{%- endblock body_header %}
<main class="content">
{% block body %} {% endblock %}
{% if builder=='html' %}
<div class="section no-print">
{% if ablog and pagename in ablog %}
{% include "postnavy.html" %}
{% include "share.html" %}
{% else %}
{% if ablog and theme_share_all %}
{% include "share.html" %}
{% endif %}
{% endif %}
{% if ablog and ablog.disqus_shortname and ablog.blog_baseurl and
(not ablog[pagename].nocomments) and
((pagename in ablog and (ablog[pagename].published or
ablog.disqus_drafts)) or
(not pagename in ablog and ablog.disqus_pages)) %}
{% include "util/disqus.html" %}
{% endif %}
{% if ablog and theme_isso and
(not ablog[pagename].nocomments) and
((pagename in ablog and (ablog[pagename].published or
ablog.disqus_drafts)) or
(not pagename in ablog and ablog.disqus_pages)) %}
<section class="comments no-print" id="comments">
<h2 class="panel">{{ _("Comments") }}</h2>
<section id="isso-thread"
data-isso-id="{{ pagename }}"
data-title="{{ title }}">
</section>
</section>
{% endif %}
</div>
{% endif %}
</main>
{%- endblock %}
{%- include "util/pagenav.html" %}

View file

@ -1,43 +1,8 @@
{%- extends "layout.html" %}
{%- block extrahead %}
{% extends "!layout.html" %}
{% block extrahead %}
{{ super() }}
{% if feed_path %}
<link rel="alternate" type="application/atom+xml" href="{{ pathto(feed_path, 1) }}/atom.xml" title="{{ feed_title }}"/>
{% endif %}
{% endblock %}
{% block body %}
{{ body }}
{% if builder=='html' %}
<div class="section no-print">
{% if ablog and pagename in ablog %}
{% include "postnavy.html" %}
{% include "share.html" %}
{% else %}
{% if ablog and theme_share_all %}
{% include "share.html" %}
{% endif %}
{% endif %}
{% if ablog and ablog.disqus_shortname and ablog.blog_baseurl and
(not ablog[pagename].nocomments) and
((pagename in ablog and (ablog[pagename].published or
ablog.disqus_drafts)) or
(not pagename in ablog and ablog.disqus_pages)) %}
{% include "util/disqus.html" %}
{% endif %}
{% if ablog and theme_isso and
(not ablog[pagename].nocomments) and
((pagename in ablog and (ablog[pagename].published or
ablog.disqus_drafts)) or
(not pagename in ablog and ablog.disqus_pages)) %}
<section class="comments no-print" id="comments">
<h2 class="panel">{{ _("Comments") }}</h2>
<section id="isso-thread"
data-isso-id="{{ pagename }}"
data-title="{{ title }}">
</section>
</section>
{% endif %}
</div>
{% endif %}
{% endblock %}