-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promote all links in the "social" box with rel="me" attribute #285
Comments
Not all links will be "me", one can add any links there, not sure about that. Some social networks would work. Might be better to just change name equals something to name in some range. |
what about expanding the <ul class="social">
{% for name, link, rel in SOCIAL %}
<li>
<a{% if name == 'mastodon' %} rel="me"{% elif rel %} rel="{{ rel }}"{% endif %} class="sc-{{ name }}" href="{{ link }}" target="_blank">
<i class="{% if name in ['envelope', 'rss'] %}fas{% else %}fab{% endif %} fa-{{ name }}"></i>
</a>
</li>
{% endfor %}
</ul> |
It would work, but breaks compatibility with older settings, which could be a no go, unless there's an easy way to have an if old style do this else do that. |
Yes, there is a way: <ul class="social">
{% for tuple in SOCIAL %}
{% set name = tuple.0 %}
{% set link = tuple.1 %}
{% set rel = tuple.2 if tuple.2 else None %}
<li>
<a{% if name == 'mastodon' %} rel="me"{% elif rel %} rel="{{ rel }}"{% endif %} class="sc-{{ name }}" href="{{ link }}" target="_blank">
<i class="{% if name in ['envelope', 'rss'] %}fas{% else %}fab{% endif %} fa-{{ name }}"></i>
</a>
</li>
{% endfor %}
</ul> (see my repo.) |
Ok, perhaps it's time for 3.0 release, where we break some compatibility, and document properly how to migrate. Pelican itself has changed a lot since the origin of this theme. I won't be against breaking changes, as long as we document everything properly, otherwise, people will open issues, which can be a problem. |
So, SOCIAL is a Pelican config, and if changed, will not be compatible with Pelican. |
That's why I 've suggested a non breaking solution. For everyone on Mastodon this is really important, as Mastodon uses this part to verify the identity. I personally don't use pelican anymore (the PR is 18 months old), so for me it's not that important. |
I think this can be closed as pelicanconf.py SOCIAL = (
("a", "https://a.example/user"),
("b", "https://b.example/username"),
("c", "https://c.example/mysite"),
)
RELME= ["a", "b"] sidebar.html {% if SOCIAL %}
{% set solid = ['at', 'envelope', 'mailbox', 'rss'] %}
<ul class="social">
{% for name, link in SOCIAL %}
<li>
<a class="sc-{{ name }}"
{% if RELME %} {% if name in RELME %}rel="me"{% endif %} {% endif %}
href="{{ link }}"
target="_blank"
aria-label="{{ name }}">
<i class="{% if name in solid %}fa-solid{% else %}fa-brands{% endif %} fa-{{ name }}"></i>
</a>
</li>
{% endfor %}
</ul>
{% endif %} |
This part here
Flex/templates/base.html
Lines 222 to 228 in a2b7d6d
could be extended to promote the
rel="me"
attribute for all social links. This is according to the corresponding microformat and would be helpful for a Web Sign In.What do you think?
The text was updated successfully, but these errors were encountered: