Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/fncnt/vncnt-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfncnt <github@vncnt.eu>2022-11-13 17:45:15 +0300
committerfncnt <github@vncnt.eu>2022-11-13 17:45:15 +0300
commitc7f9b1eaead3d79838e0c0c7b481d5b1e76e0fad (patch)
treee25850a04884fdfc46b90323af7f63afdce6ca95
parent32afe0e679e6c0a969b58b57018ea2d071d0269a (diff)
Make rel=me an opt-in configuration property.
-rw-r--r--README.md7
-rw-r--r--config.toml15
-rw-r--r--exampleSite/config.toml15
-rw-r--r--layouts/partials/body.html7
4 files changed, 39 insertions, 5 deletions
diff --git a/README.md b/README.md
index 55fa3ce..5896994 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,13 @@ Also, regardless of the key order in your `config.toml` file, the links will be
However, you may specify contact links more verbosely, as documented in [`config.toml`](config.toml).
This allows to use other fontawesome styles and manually sort contact links.
+#### `rel="me"`
+
+This theme now allows to set the [`rel="me"`](https://microformats.org/wiki/rel-me) value manually.
+Previously, this was always set but now is done on an opt-in basis to give more control over link verification.
+Services like Github or [Mastodon](https://docs.joinmastodon.org/user/profile/#verification) make use of this.
+An example is given in the provided `config.toml` file.
+
## Third-party Components
The spine (I'm so sorry) of this theme is made of [`Barebones`](https://github.com/acahir/Barebones).
diff --git a/config.toml b/config.toml
index 8f772e3..9c6816d 100644
--- a/config.toml
+++ b/config.toml
@@ -33,6 +33,7 @@ _merge = "none"
error404 = "There is no such page."
[params.contact]
+ # the default fontawesome style in simple key-value pairs is "fab", i.e. brand icons
github = "https://github.com/jdoe"
instagram = "https://instagram.com/jdoe"
twitter = "https://twitter.com/jdoe"
@@ -42,7 +43,7 @@ _merge = "none"
# Just make sure not to mix key-value pairs, inline tables and tables,
# although keeping keeping this order is ok.
# See https://toml.io/en/v1.0.0 for details
- 0 = { name = "ello", icon = "ello", style = "fab", link = "" } # empty links are relative to site root
+ 0 = { name = "ello", icon = "ello", style = "fab", link = "" } # empty links are possible
[params.contact.1] # key names are sorted lexicographically
name = "hiking club" # may be omitted. defaults to key name
icon = "hiking" # may be omitted. defaults to key name
@@ -53,4 +54,16 @@ _merge = "none"
icon = "envelope" # may be omitted. defaults to key name
style = "fas" # may be omitted. default = "fas"
link = "mailto:john.doe@example.com"
+ [params.contact.mastodon]
+ style = "fab" # may be omitted. default = "fas"
+ link = "https://example.social/@jdoe"
+ # By default rel="me" is not set
+ # For some services, it makes sense to set it though.
+ # This is the case for Mastodon (and Github) if you link back from these services.
+ # See
+ # https://microformats.org/wiki/rel-me and
+ # https://docs.joinmastodon.org/user/profile/#verification
+ # for more information.
+ # This defaults to false to cover the case of not having control over the linked site.
+ rel-me = true
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 104270e..4c56d0f 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -33,6 +33,7 @@ _merge = "none"
error404 = "There is no such page."
[params.contact]
+ # the default fontawesome style in simple key-value pairs is "fab", i.e. brand icons
github = "https://github.com/jdoe"
instagram = "https://instagram.com/jdoe"
twitter = "https://twitter.com/jdoe"
@@ -42,7 +43,7 @@ _merge = "none"
# Just make sure not to mix key-value pairs, inline tables and tables,
# although keeping keeping this order is ok.
# See https://toml.io/en/v1.0.0 for details
- 0 = { name = "ello", icon = "ello", style = "fab", link = "" } # empty links are relative to site root
+ 0 = { name = "ello", icon = "ello", style = "fab", link = "" } # empty links are possible
[params.contact.1] # key names are sorted lexicographically
name = "hiking club" # may be omitted. defaults to key name
icon = "hiking" # may be omitted. defaults to key name
@@ -53,4 +54,16 @@ _merge = "none"
icon = "envelope" # may be omitted. defaults to key name
style = "fas" # may be omitted. default = "fas"
link = "mailto:john.doe@example.com"
+ [params.contact.mastodon]
+ style = "fab" # may be omitted. default = "fas"
+ link = "https://example.social/@jdoe"
+ # By default rel="me" is not set
+ # For some services, it makes sense to set it though.
+ # This is the case for Mastodon (and Github) if you link back from these services.
+ # See
+ # https://microformats.org/wiki/rel-me and
+ # https://docs.joinmastodon.org/user/profile/#verification
+ # for more information.
+ # This defaults to false to cover the case of not having control over the linked site.
+ rel-me = true
diff --git a/layouts/partials/body.html b/layouts/partials/body.html
index 15141c1..9a96525 100644
--- a/layouts/partials/body.html
+++ b/layouts/partials/body.html
@@ -13,7 +13,7 @@
<section id="contact" aria-label="Contact">
<div class="icons" aria-label="Links">
<h2 class="h3-like" aria-label="Link Icons">
- {{ with .Site.Params.email }}<a class="icon" href="mailto:{{ . }}" target="_blank" rel="noopener me">
+ {{ with .Site.Params.email }}<a class="icon" href="mailto:{{ . }}" target="_blank" rel="noopener">
<i class="fas fa-envelope" title="email" aria-label="Send email."></i>
</a>{{ end }}
{{ range $contact_key, $contact := .Site.Params.contact }}
@@ -21,10 +21,11 @@
{{ $style := default "fas" (index $contact "style") }}
{{ $icon := default $contact_key (index $contact "icon") }}
{{ $label := default $contact_key (index $contact "name") }}
- <a class="icon" href="{{ index $contact "link" }}" target="_blank" rel="noopener me">
+ {{ $relme := cond (default false (index $contact "rel-me")) " me" "" }}
+ <a class="icon" href="{{ index $contact "link" }}" target="_blank" rel="noopener{{ $relme }}">
<i class="{{ $style }} fa-{{ $icon }}" title="{{ $label }}" aria-label="Go to {{ $label }}."></i>
{{ else }}
- <a class="icon" href="{{ $contact }}" target="_blank" rel="noopener me">
+ <a class="icon" href="{{ $contact }}" target="_blank" rel="noopener">
<i class="fab fa-{{ $contact_key }}" title="{{ $contact_key }}" aria-label="Go to {{ $contact_key }}."></i>
{{ end }}
</a>{{ end }}