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 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*) 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 = { html_theme_options = {
"logoalt": project, "logoalt": project,
"social": [ "social": [
('iconset', 'icon', 'text', 'link'), # Last parameter activate rel=me link
('iconset', 'icon', 'text', 'link', True),
('iconset', 'icon', 'text', 'link', False),
], ],
"external_languages": [ "external_languages": [
('code', 'label to show', 'base url'), ('code', 'label to show', 'base url'),

View file

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

View file

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

View file

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

View file

@ -5,7 +5,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__ = (2, 0, 4) __version__ = (2, 0, 6)
class SimpleTocTreeCollector(EnvironmentCollector): class SimpleTocTreeCollector(EnvironmentCollector):
@ -77,7 +77,6 @@ def add_toctree_data(app, pagename, templatename, context, doctree):
:return: None :return: None
""" """
# print(f"---------- Context\n{pagename}\n-------------\n")
# start from master_doc # start from master_doc
master = app.env.get_doctree(app.env.config.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 #} {# prev/next are not set for drafts #}
{% set post = ablog[pagename] %} {% set post = ablog[pagename] %}
{% if post.published %} {% if post.published %}
<nav class="section"> <nav class="section no-print">
<span style="float: left;"> <span style="float: left;">
{% if post.prev and theme_ablog_prevnext %} {% if post.prev and theme_ablog_prevnext %}
{{ gettext('Previous') }}: {{ gettext('Previous') }}:

View file

@ -2,9 +2,10 @@
<div class="sidebar-group"> <div class="sidebar-group">
<ul class="social"> <ul class="social">
{% for iconset, icon, text, link in theme_social %} {% for iconset, icon, text, link, me in theme_social %}
<li><a <li><a
class="fasvglink {{ icon }}" href="{{ link }}" class="fasvglink {{ icon }}" href="{{ link }}"
{% if me %}rel="me"{% endif %}
target="_blank"> target="_blank">
<svg role="img" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title=""> <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 }}"> <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"> <ul class="page-nav no-print">
{%- if prev and theme_prevnext %} {%- if prev and theme_prevnext %}
<li class="prev no-print"> <li class="prev no-print">
@ -12,3 +14,4 @@
</li> </li>
{%- endif %} {%- endif %}
</ul> </ul>
{% endif %}