Add Microformats (#3052)

* Add rel=me to author profile links

* Add h-card Microformats markup

* Add h-entry microformat markup

* Fix missing anchor tag

* Fix h-entry microformat markup on single template

* Use minimal subset of Microformat elements

* Move dt-published to `page__date.html` and remove dt-updated
* Remove "author" and "summary"

Leaves "url" as a hidden element

* Add page link to h1 tag

The h1 tag now contains the Schema-org `url` itemprop and the
Microformats `url` class in an anchor tag.  The anchor tag is styled to
not look like a link.

* Put author 'u-url' on author__name h3

This also puts the same `{{ author.home | default: '/' | absolute_url }}`
construct on `author__avatar` to remove the Jekyll `author.home`
conditional.

Also addresses SCSS text color error.
This commit is contained in:
Peter Murray 2021-07-23 14:16:08 -04:00 committed by GitHub
parent 42f7512702
commit 65e79f5a7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 53 deletions

View file

@ -1,6 +1,6 @@
<!--
<li>
<a href="http://link-to-whatever-social-network.com/user/" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="http://link-to-whatever-social-network.com/user/" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fas fa-fw" aria-hidden="true"></i> Custom Social Profile Link
</a>
</li>

View file

@ -1,28 +1,22 @@
{% assign author = page.author | default: page.authors[0] | default: site.author %}
{% assign author = site.data.authors[author] | default: author %}
<div itemscope itemtype="https://schema.org/Person">
<div itemscope itemtype="https://schema.org/Person" class="h-card">
{% if author.avatar %}
<div class="author__avatar">
{% if author.home %}
<a href="{{ author.home | relative_url }}">
<img src="{{ author.avatar | relative_url }}" alt="{{ author.name }}" itemprop="image">
</a>
{% else %}
<img src="{{ author.avatar | relative_url }}" alt="{{ author.name }}" itemprop="image">
{% endif %}
<a href="{{ author.home | default: '/' | absolute_url }}">
<img src="{{ author.avatar | relative_url }}" alt="{{ author.name }}" itemprop="image" class="u-photo">
</a>
</div>
{% endif %}
<div class="author__content">
{% if author.home %}
<a href="{{ author.home | relative_url }}"><h3 class="author__name" itemprop="name">{{ author.name }}</h3></a>
{% else %}
<h3 class="author__name" itemprop="name">{{ author.name }}</h3>
{% endif %}
<h3 class="author__name p-name" itemprop="name">
<a class="u-url" rel="me" href="{{ author.home | default: '/' | absolute_url }}" itemprop="url">{{ author.name }}</a>
</h3>
{% if author.bio %}
<div class="author__bio" itemprop="description">
<div class="author__bio p-note" itemprop="description">
{{ author.bio | markdownify }}
</div>
{% endif %}
@ -33,21 +27,21 @@
<ul class="author__urls social-icons">
{% if author.location %}
<li itemprop="homeLocation" itemscope itemtype="https://schema.org/Place">
<i class="fas fa-fw fa-map-marker-alt" aria-hidden="true"></i> <span itemprop="name">{{ author.location }}</span>
<i class="fas fa-fw fa-map-marker-alt" aria-hidden="true"></i> <span itemprop="name" class="p-locality">{{ author.location }}</span>
</li>
{% endif %}
{% if author.links %}
{% for link in author.links %}
{% if link.label and link.url %}
<li><a href="{{ link.url }}" rel="nofollow noopener noreferrer"><i class="{{ link.icon | default: 'fas fa-link' }}" aria-hidden="true"></i><span class="label">{{ link.label }}</span></a></li>
<li><a href="{{ link.url }}" rel="nofollow noopener noreferrer me"><i class="{{ link.icon | default: 'fas fa-link' }}" aria-hidden="true"></i><span class="label">{{ link.label }}</span></a></li>
{% endif %}
{% endfor %}
{% endif %}
{% if author.uri %}
<li>
<a href="{{ author.uri }}" itemprop="url">
<a href="{{ author.uri }}" itemprop="url" rel="me">
<i class="fas fa-fw fa-link" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[site.locale].website_label | default: "Website" }}</span>
</a>
</li>
@ -55,7 +49,7 @@
{% if author.email %}
<li>
<a href="mailto:{{ author.email }}">
<a href="mailto:{{ author.email }}" rel="me" class="u-email">
<meta itemprop="email" content="{{ author.email }}" />
<i class="fas fa-fw fa-envelope-square" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[site.locale].email_label | default: "Email" }}</span>
</a>
@ -64,7 +58,7 @@
{% if author.keybase %}
<li>
<a href="https://keybase.io/{{ author.keybase }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://keybase.io/{{ author.keybase }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fas fa-fw fa-key" aria-hidden="true"></i><span class="label">Keybase</span>
</a>
</li>
@ -72,7 +66,7 @@
{% if author.twitter %}
<li>
<a href="https://twitter.com/{{ author.twitter }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://twitter.com/{{ author.twitter }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-twitter-square" aria-hidden="true"></i><span class="label">Twitter</span>
</a>
</li>
@ -80,7 +74,7 @@
{% if author.facebook %}
<li>
<a href="https://www.facebook.com/{{ author.facebook }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://www.facebook.com/{{ author.facebook }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-facebook-square" aria-hidden="true"></i><span class="label">Facebook</span>
</a>
</li>
@ -88,7 +82,7 @@
{% if author.linkedin %}
<li>
<a href="https://www.linkedin.com/in/{{ author.linkedin }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://www.linkedin.com/in/{{ author.linkedin }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-linkedin" aria-hidden="true"></i><span class="label">LinkedIn</span>
</a>
</li>
@ -96,7 +90,7 @@
{% if author.xing %}
<li>
<a href="https://www.xing.com/profile/{{ author.xing }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://www.xing.com/profile/{{ author.xing }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-xing-square" aria-hidden="true"></i><span class="label">XING</span>
</a>
</li>
@ -104,7 +98,7 @@
{% if author.instagram %}
<li>
<a href="https://instagram.com/{{ author.instagram }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://instagram.com/{{ author.instagram }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-instagram" aria-hidden="true"></i><span class="label">Instagram</span>
</a>
</li>
@ -112,7 +106,7 @@
{% if author.tumblr %}
<li>
<a href="https://{{ author.tumblr }}.tumblr.com" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://{{ author.tumblr }}.tumblr.com" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-tumblr-square" aria-hidden="true"></i><span class="label">Tumblr</span>
</a>
</li>
@ -120,7 +114,7 @@
{% if author.bitbucket %}
<li>
<a href="https://bitbucket.org/{{ author.bitbucket }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://bitbucket.org/{{ author.bitbucket }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-bitbucket" aria-hidden="true"></i><span class="label">Bitbucket</span>
</a>
</li>
@ -128,7 +122,7 @@
{% if author.github %}
<li>
<a href="https://github.com/{{ author.github }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://github.com/{{ author.github }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-github" aria-hidden="true"></i><span class="label">GitHub</span>
</a>
</li>
@ -136,7 +130,7 @@
{% if author.gitlab %}
<li>
<a href="https://gitlab.com/{{ author.gitlab }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://gitlab.com/{{ author.gitlab }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-gitlab" aria-hidden="true"></i><span class="label">GitLab</span>
</a>
</li>
@ -144,7 +138,7 @@
{% if author.stackoverflow %}
<li>
<a href="https://stackoverflow.com/users/{{ author.stackoverflow }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://stackoverflow.com/users/{{ author.stackoverflow }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-stack-overflow" aria-hidden="true"></i><span class="label">Stack Overflow</span>
</a>
</li>
@ -152,7 +146,7 @@
{% if author.lastfm %}
<li>
<a href="https://last.fm/user/{{ author.lastfm }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://last.fm/user/{{ author.lastfm }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-lastfm-square" aria-hidden="true"></i><span class="label">Last.fm</span>
</a>
</li>
@ -160,7 +154,7 @@
{% if author.dribbble %}
<li>
<a href="https://dribbble.com/{{ author.dribbble }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://dribbble.com/{{ author.dribbble }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-dribbble" aria-hidden="true"></i><span class="label">Dribbble</span>
</a>
</li>
@ -168,7 +162,7 @@
{% if author.pinterest %}
<li>
<a href="https://www.pinterest.com/{{ author.pinterest }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://www.pinterest.com/{{ author.pinterest }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-pinterest" aria-hidden="true"></i><span class="label">Pinterest</span>
</a>
</li>
@ -176,7 +170,7 @@
{% if author.foursquare %}
<li>
<a href="https://foursquare.com/{{ author.foursquare }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://foursquare.com/{{ author.foursquare }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-foursquare" aria-hidden="true"></i><span class="label">Foursquare</span>
</a>
</li>
@ -184,7 +178,7 @@
{% if author.steam %}
<li>
<a href="https://steamcommunity.com/id/{{ author.steam }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://steamcommunity.com/id/{{ author.steam }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-steam" aria-hidden="true"></i><span class="label">Steam</span>
</a>
</li>
@ -193,13 +187,13 @@
{% if author.youtube %}
{% if author.youtube contains "://" %}
<li>
<a href="{{ author.youtube }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="{{ author.youtube }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-youtube" aria-hidden="true"></i><span class="label">YouTube</span>
</a>
</li>
{% elsif author.youtube %}
<li>
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-youtube" aria-hidden="true"></i><span class="label">YouTube</span>
</a>
</li>
@ -208,7 +202,7 @@
{% if author.soundcloud %}
<li>
<a href="https://soundcloud.com/{{ author.soundcloud }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://soundcloud.com/{{ author.soundcloud }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-soundcloud" aria-hidden="true"></i><span class="label">SoundCloud</span>
</a>
</li>
@ -216,7 +210,7 @@
{% if author.weibo %}
<li>
<a href="https://www.weibo.com/{{ author.weibo }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://www.weibo.com/{{ author.weibo }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-weibo" aria-hidden="true"></i><span class="label">Weibo</span>
</a>
</li>
@ -224,7 +218,7 @@
{% if author.flickr %}
<li>
<a href="https://www.flickr.com/{{ author.flickr }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://www.flickr.com/{{ author.flickr }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-flickr" aria-hidden="true"></i><span class="label">Flickr</span>
</a>
</li>
@ -232,7 +226,7 @@
{% if author.codepen %}
<li>
<a href="https://codepen.io/{{ author.codepen }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://codepen.io/{{ author.codepen }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-codepen" aria-hidden="true"></i><span class="label">CodePen</span>
</a>
</li>
@ -240,7 +234,7 @@
{% if author.vine %}
<li>
<a href="https://vine.co/u/{{ author.vine }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
<a href="https://vine.co/u/{{ author.vine }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
<i class="fab fa-fw fa-vine" aria-hidden="true"></i><span class="label">{{ site.data.ui-text[site.locale].email_label | default: "Email" }}</span>
</a>
</li>
@ -249,4 +243,4 @@
{% include author-profile-custom-links.html %}
</ul>
</div>
</div>
</div>

View file

@ -12,7 +12,7 @@
<strong><i class="fas fa-fw fa-folder-open" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].categories_label | default: "Categories:" }} </strong>
<span itemprop="keywords">
{% for category_word in categories_sorted %}
<a href="{{ category_word | slugify | prepend: path_type | prepend: site.category_archive.path | relative_url }}" class="page__taxonomy-item" rel="tag">{{ category_word }}</a>{% unless forloop.last %}<span class="sep">, </span>{% endunless %}
<a href="{{ category_word | slugify | prepend: path_type | prepend: site.category_archive.path | relative_url }}" class="page__taxonomy-item p-category" rel="tag">{{ category_word }}</a>{% unless forloop.last %}<span class="sep">, </span>{% endunless %}
{% endfor %}
</span>
</p>

View file

@ -1,6 +1,6 @@
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
{% if page.last_modified_at %}
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.last_modified_at | date: "%Y-%m-%d" }}">{{ page.last_modified_at | date: date_format }}</time></p>
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time class="dt-published" datetime="{{ page.last_modified_at | date: "%Y-%m-%d" }}">{{ page.last_modified_at | date: date_format }}</time></p>
{% elsif page.date %}
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: date_format }}</time></p>
{% endif %}
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: date_format }}</time></p>
{% endif %}

View file

@ -12,7 +12,7 @@
<strong><i class="fas fa-fw fa-tags" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].tags_label | default: "Tags:" }} </strong>
<span itemprop="keywords">
{% for tag_word in tags_sorted %}
<a href="{{ tag_word | slugify | prepend: path_type | prepend: site.tag_archive.path | relative_url }}" class="page__taxonomy-item" rel="tag">{{ tag_word }}</a>{% unless forloop.last %}<span class="sep">, </span>{% endunless %}
<a href="{{ tag_word | slugify | prepend: path_type | prepend: site.tag_archive.path | relative_url }}" class="page__taxonomy-item p-category" rel="tag">{{ tag_word }}</a>{% unless forloop.last %}<span class="sep">, </span>{% endunless %}
{% endfor %}
</span>
</p>

View file

@ -17,7 +17,7 @@ layout: default
<div id="main" role="main">
{% include sidebar.html %}
<article class="page" itemscope itemtype="https://schema.org/CreativeWork">
<article class="page h-entry" itemscope itemtype="https://schema.org/CreativeWork">
{% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
{% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
{% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date_to_xmlschema }}">{% endif %}
@ -26,12 +26,14 @@ layout: default
<div class="page__inner-wrap">
{% unless page.header.overlay_color or page.header.overlay_image %}
<header>
{% if page.title %}<h1 id="page-title" class="page__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>{% endif %}
{% if page.title %}<h1 id="page-title" class="page__title p-name" itemprop="headline">
<a href="{{ page.url | absolute_url }}" class="u-url" itemprop="url">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</a>
</h1>{% endif %}
{% include page__meta.html %}
</header>
{% endunless %}
<section class="page__content" itemprop="text">
<section class="page__content e-content" itemprop="text">
{% if page.toc %}
<aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
<nav class="toc">
@ -86,4 +88,4 @@ layout: default
</div>
</div>
{% endif %}
</div>
</div>

View file

@ -72,6 +72,11 @@ body {
margin-top: 0;
line-height: 1;
a {
color: $text-color;
text-decoration: none;
}
& + .page__meta {
margin-top: -0.5em;
}
@ -556,4 +561,4 @@ body {
padding-right: 0;
}
}
}
}