Set rel attributes to links (fixes #40)
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
{#- Taken from https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/ -#}
|
||||
{#- Attachment code taken from https://github.com/cassidyjames/cassidyjames.github.io/blob/99782788a7e3ba3cc52d6803010873abd1b02b9e/_includes/comments.html#L251-L296 -#}
|
||||
|
||||
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
|
||||
|
||||
{%- if page.extra.comments.host -%}
|
||||
{%- set host = page.extra.comments.host -%}
|
||||
{%- else -%}
|
||||
@ -26,7 +28,7 @@
|
||||
<button id="load-comments" class="inline-button" onclick="loadComments()">
|
||||
{{- macros_translate::translate(key="load_comments", default="Load Comments", language_strings=language_strings) -}}
|
||||
</button>
|
||||
<a class="inline-button colored external" href="https://{{ host }}/@{{ username }}/{{ id }}">
|
||||
<a class="inline-button colored external" href="https://{{ host }}/@{{ username }}/{{ id }}" rel="{{ rel_attributes }}">
|
||||
{{- macros_translate::translate(key="open_post", default="Open Post", language_strings=language_strings) -}}
|
||||
</a>
|
||||
</div>
|
||||
@ -147,7 +149,7 @@
|
||||
let avatar = document.createElement("a");
|
||||
avatar.className = "avatar-link";
|
||||
avatar.setAttribute("href", status.account.url);
|
||||
avatar.setAttribute("rel", "external nofollow");
|
||||
avatar.setAttribute("rel", "{{ rel_attributes }}");
|
||||
avatar.setAttribute(
|
||||
"title",
|
||||
`{{ macros_translate::translate(key="view_profile", default="View profile at", language_strings=language_strings) }} @${status.account.username}@${instance}`
|
||||
@ -161,7 +163,7 @@
|
||||
"title",
|
||||
`@${status.account.username}@${instance}`
|
||||
);
|
||||
instanceBadge.setAttribute("rel", "external nofollow");
|
||||
instanceBadge.setAttribute("rel", "{{ rel_attributes }}");
|
||||
instanceBadge.textContent = instance;
|
||||
|
||||
let display = document.createElement("span");
|
||||
@ -179,7 +181,7 @@
|
||||
permalink.setAttribute("href", status.url);
|
||||
permalink.setAttribute("itemprop", "url");
|
||||
permalink.setAttribute("title", `{{ macros_translate::translate(key="view_comment", default="View comment at", language_strings=language_strings) }} ${instance}`);
|
||||
permalink.setAttribute("rel", "external nofollow");
|
||||
permalink.setAttribute("rel", "{{ rel_attributes }}");
|
||||
permalink.textContent = new Date(
|
||||
status.created_at
|
||||
).toLocaleString("{{ date_locale }}", {
|
||||
|
@ -1,3 +1,5 @@
|
||||
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
|
||||
|
||||
<footer id="site-footer">
|
||||
{%- if config.extra.footer.links %}
|
||||
<nav>
|
||||
@ -5,7 +7,7 @@
|
||||
{%- for link in config.extra.footer.links %}
|
||||
{%- if link.url is matching('https?://') %}
|
||||
<li>
|
||||
<a href="{{ link.url }}">
|
||||
<a href="{{ link.url }}" rel="{{ rel_attributes }}">
|
||||
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
|
||||
</a>
|
||||
</li>
|
||||
@ -31,7 +33,7 @@
|
||||
|
||||
{%- if config.extra.source_url and config.extra.footer.show_source %}
|
||||
<p>
|
||||
<a href="{{ config.extra.source_url }}">
|
||||
<a href="{{ config.extra.source_url }}" rel="{{ rel_attributes }}">
|
||||
{{- macros_translate::translate(key="source", default="Website source", language_strings=language_strings) -}}
|
||||
</a>
|
||||
</p>
|
||||
@ -40,7 +42,7 @@
|
||||
{%- if config.extra.footer.show_powered_by %}
|
||||
<p>
|
||||
<small>
|
||||
{{ macros_translate::translate(key="powered_by", default="Powered by", language_strings=language_strings) }} <a class="link" href="https://www.getzola.org">Zola</a> {{ macros_translate::translate(key="powered_by_and", default="and", language_strings=language_strings) }} <a class="link" href="https://duckquill.daudix.one">Duckquill</a>
|
||||
{{ macros_translate::translate(key="powered_by", default="Powered by", language_strings=language_strings) }} <a class="link" href="https://www.getzola.org" rel="{{ rel_attributes }}">Zola</a> {{ macros_translate::translate(key="powered_by_and", default="and", language_strings=language_strings) }} <a class="link" href="https://duckquill.daudix.one" rel="{{ rel_attributes }}">Duckquill</a>
|
||||
</small>
|
||||
</p>
|
||||
{%- endif %}
|
||||
@ -49,7 +51,7 @@
|
||||
<ul id="socials">
|
||||
{%- for link in config.extra.footer.socials %}
|
||||
<li>
|
||||
<a href="{{ link.url | safe }}" rel="me" title="{{ link.name }}">
|
||||
<a href="{{ link.url | safe }}" rel="{{ rel_attributes }} me" title="{{ link.name }}">
|
||||
<i class="icon" style='mask-image: url("data:image/svg+xml,{{ link.icon }}"); -webkit-mask-image: url("data:image/svg+xml,{{ link.icon }}")'></i>
|
||||
<span>{{ link.name }}</span>
|
||||
</a>
|
||||
|
@ -1,3 +1,5 @@
|
||||
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
|
||||
|
||||
<header id="site-nav">
|
||||
<nav>
|
||||
<a href="#main" id="main-content" tabindex="0">
|
||||
@ -15,7 +17,7 @@
|
||||
{%- for link in config.extra.nav.links %}
|
||||
{%- if link.url is matching('https?://') %}
|
||||
<li>
|
||||
<a href="{{ link.url }}"
|
||||
<a href="{{ link.url }}" rel="{{ rel_attributes }}"
|
||||
{%- if current_url | default(value='/') | trim_end_matches(pat='/') | safe == link.url | trim_end_matches(pat='/') | safe -%}
|
||||
class="active"
|
||||
{%- endif -%}>
|
||||
|
Reference in New Issue
Block a user