Add rel=me

This commit is contained in:
Kujiu 2022-05-05 01:31:26 +02:00
parent cb45610f1d
commit dc2f6d440c
Signed by: kujiu
GPG Key ID: ABBB2CAC6855599F
9 changed files with 25 additions and 8 deletions

12
CHANGES
View File

@ -2,6 +2,18 @@
Changes
=======
2.0.6 (*2022-05-05*)
====================
- Add rel=me in social links: New syntax for social networks.
Update your configs!
2.0.5 (*2021-05-14*)
====================
- Fix double previous/next links with ablog
2.0.4 (*2021-05-14*)
====================

View File

@ -60,7 +60,9 @@ If provided, creates external links (e.g. Github) in the top right corner:
html_theme_options = {
"logoalt": project,
"social": [
('iconset', 'icon', 'text', 'link'),
# Last parameter activate rel=me link
('iconset', 'icon', 'text', 'link', True),
('iconset', 'icon', 'text', 'link', False),
],
"external_languages": [
('code', 'label to show', 'base url'),

View File

@ -1,6 +1,6 @@
{
"name": "sphinx_nervproject_theme",
"version": "2.0.4",
"version": "2.0.6",
"description": "Sphinx Nerv Project Theme",
"main": "index.js",
"directories": {

View File

@ -10,7 +10,7 @@ license-files =
[extract_messages]
mapping_file = babel.cfg
output_file = sphinx_nervproject_theme/locale/sphinx.pot
keywords = _ l_ lazy_gettext gettext ngettext
keywords = _ __ l_ lazy_gettext gettext ngettext
add_comments = Translators:
[init_catalog]

View File

@ -28,7 +28,7 @@ with open("README.rst", "r") as fh:
setup(
name="sphinx_nervproject_theme",
version="2.0.4",
version="2.0.6",
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, 4)
__version__ = (2, 0, 6)
class SimpleTocTreeCollector(EnvironmentCollector):
@ -77,7 +77,6 @@ def add_toctree_data(app, pagename, templatename, context, doctree):
:return: None
"""
# print(f"---------- Context\n{pagename}\n-------------\n")
# start from master_doc
master = app.env.get_doctree(app.env.config.master_doc)

View File

@ -1,7 +1,7 @@
{# prev/next are not set for drafts #}
{% set post = ablog[pagename] %}
{% if post.published %}
<nav class="section">
<nav class="section no-print">
<span style="float: left;">
{% if post.prev and theme_ablog_prevnext %}
{{ gettext('Previous') }}:

View File

@ -2,9 +2,10 @@
<div class="sidebar-group">
<ul class="social">
{% for iconset, icon, text, link in theme_social %}
{% for iconset, icon, text, link, me in theme_social %}
<li><a
class="fasvglink {{ icon }}" href="{{ link }}"
{% if me %}rel="me"{% endif %}
target="_blank">
<svg role="img" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="">
<use xlink:href="{{ pathto('_static/fa/' + iconset + '.svg', 1)}}#{{ icon }}">

View File

@ -1,3 +1,5 @@
{% set post = ablog[pagename] %}
{% if not post or not post.published %}
<ul class="page-nav no-print">
{%- if prev and theme_prevnext %}
<li class="prev no-print">
@ -12,3 +14,4 @@
</li>
{%- endif %}
</ul>
{% endif %}