Fix ISSO and JS
This commit is contained in:
parent
ed193490ed
commit
cf9a89b07b
10 changed files with 57 additions and 18 deletions
6
CHANGES
6
CHANGES
|
@ -2,6 +2,12 @@
|
||||||
Changes
|
Changes
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
1.1.2 (*2020-06-21*)
|
||||||
|
====================
|
||||||
|
|
||||||
|
- Update JS and version number.
|
||||||
|
- Reintroduce Isso support.
|
||||||
|
|
||||||
1.1.1 (*2020-06-20*)
|
1.1.1 (*2020-06-20*)
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sphinx_nervproject_theme",
|
"name": "sphinx_nervproject_theme",
|
||||||
"version": "1.0.0",
|
"version": "1.1.2",
|
||||||
"description": "Sphinx Nerv Project Theme",
|
"description": "Sphinx Nerv Project Theme",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -28,7 +28,7 @@ with open("README.rst", "r") as fh:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="sphinx_nervproject_theme",
|
name="sphinx_nervproject_theme",
|
||||||
version="1.1.1",
|
version="1.1.2",
|
||||||
url="https://procrastinator.nerv-project.eu/nerv-project/communication/sphinx_nervproject_theme",
|
url="https://procrastinator.nerv-project.eu/nerv-project/communication/sphinx_nervproject_theme",
|
||||||
license="EUPL 1.2",
|
license="EUPL 1.2",
|
||||||
author="Kujiu",
|
author="Kujiu",
|
||||||
|
|
|
@ -6,7 +6,7 @@ from sphinx.environment.collectors import EnvironmentCollector
|
||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
from sphinx.util.osutil import relative_uri
|
from sphinx.util.osutil import relative_uri
|
||||||
|
|
||||||
__version__ = (1, 1, 1)
|
__version__ = (1, 1, 2)
|
||||||
|
|
||||||
|
|
||||||
sys.setrecursionlimit(15000)
|
sys.setrecursionlimit(15000)
|
||||||
|
|
|
@ -60,8 +60,6 @@
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
<script src="{{ pathto('_static/sphinx_nervproject_theme.js', 1)}}" defer></script>
|
<script src="{{ pathto('_static/sphinx_nervproject_theme.js', 1)}}" defer></script>
|
||||||
|
|
||||||
<script src="{{ pathto('_static/sphinx_nervproject_theme.js', 1)}}" defer></script>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- endblock %}
|
{%- endblock %}
|
||||||
{%- if pageurl %}
|
{%- if pageurl %}
|
||||||
|
|
|
@ -25,6 +25,19 @@
|
||||||
(not pagename in ablog and ablog.disqus_pages)) %}
|
(not pagename in ablog and ablog.disqus_pages)) %}
|
||||||
{% include "util/disqus.html" %}
|
{% include "util/disqus.html" %}
|
||||||
{% endif %}
|
{% 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" id="comments">
|
||||||
|
<h2 class="panel">{{ _("Comments") }}</h2>
|
||||||
|
<section id="isso-thread"
|
||||||
|
data-isso-id="{{ pagename }}"
|
||||||
|
data-title="{{ title }}">
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,13 +1,29 @@
|
||||||
function toggleSidebar() {
|
"use strict";
|
||||||
document.querySelector('#sidebar').toggleAttribute('opened');
|
|
||||||
|
class SidebarButton {
|
||||||
|
constructor() {
|
||||||
|
if(document.sidebarButtonLoaded===true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.buttonToggle = document.querySelector('button.sidebar-button');
|
||||||
|
|
||||||
|
if(this.buttonToggle!==undefined) {
|
||||||
|
document.sidebarButtonLoaded = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.buttonToggle.addEventListener('click', event => {
|
||||||
|
this.toggleSidebar();
|
||||||
|
});
|
||||||
|
this.buttonToggle.addEventListener('keydown', event => {
|
||||||
|
if(event.keyCode === 13 || event.keyCode === 32 ) {
|
||||||
|
this.toggleSidebar();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleSidebar() {
|
||||||
|
document.querySelector('#sidebar').toggleAttribute('opened');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const buttonToggle = document.querySelector('button.sidebar-button');
|
new SidebarButton();
|
||||||
buttonToggle.addEventListener('click', event => {
|
|
||||||
toggleSidebar();
|
|
||||||
});
|
|
||||||
buttonToggle.addEventListener('keydown', event => {
|
|
||||||
if(event.keyCode === 13 || event.keyCode === 32 ) {
|
|
||||||
toggleSidebar();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
|
@ -40,6 +40,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.sidebar-button {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
box-shadow: 0 0 @SdBClr, -0.3em 0.1em 0.2em 0.3em @NvBgClr;
|
box-shadow: 0 0 @SdBClr, -0.3em 0.1em 0.2em 0.3em @NvBgClr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue