Skip to content

Commit 65e79f5

Browse files
authoredJul 23, 2021
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.
1 parent 42f7512 commit 65e79f5

File tree

7 files changed

+54
-53
lines changed

7 files changed

+54
-53
lines changed
 

‎_includes/author-profile-custom-links.html

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

‎_includes/author-profile.html

+36-42
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
{% assign author = page.author | default: page.authors[0] | default: site.author %}
22
{% assign author = site.data.authors[author] | default: author %}
33

4-
<div itemscope itemtype="https://schema.org/Person">
4+
<div itemscope itemtype="https://schema.org/Person" class="h-card">
55

66
{% if author.avatar %}
77
<div class="author__avatar">
8-
{% if author.home %}
9-
<a href="{{ author.home | relative_url }}">
10-
<img src="{{ author.avatar | relative_url }}" alt="{{ author.name }}" itemprop="image">
11-
</a>
12-
{% else %}
13-
<img src="{{ author.avatar | relative_url }}" alt="{{ author.name }}" itemprop="image">
14-
{% endif %}
8+
<a href="{{ author.home | default: '/' | absolute_url }}">
9+
<img src="{{ author.avatar | relative_url }}" alt="{{ author.name }}" itemprop="image" class="u-photo">
10+
</a>
1511
</div>
1612
{% endif %}
1713

1814
<div class="author__content">
19-
{% if author.home %}
20-
<a href="{{ author.home | relative_url }}"><h3 class="author__name" itemprop="name">{{ author.name }}</h3></a>
21-
{% else %}
22-
<h3 class="author__name" itemprop="name">{{ author.name }}</h3>
23-
{% endif %}
15+
<h3 class="author__name p-name" itemprop="name">
16+
<a class="u-url" rel="me" href="{{ author.home | default: '/' | absolute_url }}" itemprop="url">{{ author.name }}</a>
17+
</h3>
2418
{% if author.bio %}
25-
<div class="author__bio" itemprop="description">
19+
<div class="author__bio p-note" itemprop="description">
2620
{{ author.bio | markdownify }}
2721
</div>
2822
{% endif %}
@@ -33,29 +27,29 @@ <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
3327
<ul class="author__urls social-icons">
3428
{% if author.location %}
3529
<li itemprop="homeLocation" itemscope itemtype="https://schema.org/Place">
36-
<i class="fas fa-fw fa-map-marker-alt" aria-hidden="true"></i> <span itemprop="name">{{ author.location }}</span>
30+
<i class="fas fa-fw fa-map-marker-alt" aria-hidden="true"></i> <span itemprop="name" class="p-locality">{{ author.location }}</span>
3731
</li>
3832
{% endif %}
3933

4034
{% if author.links %}
4135
{% for link in author.links %}
4236
{% if link.label and link.url %}
43-
<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>
37+
<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>
4438
{% endif %}
4539
{% endfor %}
4640
{% endif %}
4741

4842
{% if author.uri %}
4943
<li>
50-
<a href="{{ author.uri }}" itemprop="url">
44+
<a href="{{ author.uri }}" itemprop="url" rel="me">
5145
<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>
5246
</a>
5347
</li>
5448
{% endif %}
5549

5650
{% if author.email %}
5751
<li>
58-
<a href="mailto:{{ author.email }}">
52+
<a href="mailto:{{ author.email }}" rel="me" class="u-email">
5953
<meta itemprop="email" content="{{ author.email }}" />
6054
<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>
6155
</a>
@@ -64,127 +58,127 @@ <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
6458

6559
{% if author.keybase %}
6660
<li>
67-
<a href="https://keybase.io/{{ author.keybase }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
61+
<a href="https://keybase.io/{{ author.keybase }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
6862
<i class="fas fa-fw fa-key" aria-hidden="true"></i><span class="label">Keybase</span>
6963
</a>
7064
</li>
7165
{% endif %}
7266

7367
{% if author.twitter %}
7468
<li>
75-
<a href="https://twitter.com/{{ author.twitter }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
69+
<a href="https://twitter.com/{{ author.twitter }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
7670
<i class="fab fa-fw fa-twitter-square" aria-hidden="true"></i><span class="label">Twitter</span>
7771
</a>
7872
</li>
7973
{% endif %}
8074

8175
{% if author.facebook %}
8276
<li>
83-
<a href="https://www.facebook.com/{{ author.facebook }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
77+
<a href="https://www.facebook.com/{{ author.facebook }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
8478
<i class="fab fa-fw fa-facebook-square" aria-hidden="true"></i><span class="label">Facebook</span>
8579
</a>
8680
</li>
8781
{% endif %}
8882

8983
{% if author.linkedin %}
9084
<li>
91-
<a href="https://www.linkedin.com/in/{{ author.linkedin }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
85+
<a href="https://www.linkedin.com/in/{{ author.linkedin }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
9286
<i class="fab fa-fw fa-linkedin" aria-hidden="true"></i><span class="label">LinkedIn</span>
9387
</a>
9488
</li>
9589
{% endif %}
9690

9791
{% if author.xing %}
9892
<li>
99-
<a href="https://www.xing.com/profile/{{ author.xing }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
93+
<a href="https://www.xing.com/profile/{{ author.xing }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
10094
<i class="fab fa-fw fa-xing-square" aria-hidden="true"></i><span class="label">XING</span>
10195
</a>
10296
</li>
10397
{% endif %}
10498

10599
{% if author.instagram %}
106100
<li>
107-
<a href="https://instagram.com/{{ author.instagram }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
101+
<a href="https://instagram.com/{{ author.instagram }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
108102
<i class="fab fa-fw fa-instagram" aria-hidden="true"></i><span class="label">Instagram</span>
109103
</a>
110104
</li>
111105
{% endif %}
112106

113107
{% if author.tumblr %}
114108
<li>
115-
<a href="https://{{ author.tumblr }}.tumblr.com" itemprop="sameAs" rel="nofollow noopener noreferrer">
109+
<a href="https://{{ author.tumblr }}.tumblr.com" itemprop="sameAs" rel="nofollow noopener noreferrer me">
116110
<i class="fab fa-fw fa-tumblr-square" aria-hidden="true"></i><span class="label">Tumblr</span>
117111
</a>
118112
</li>
119113
{% endif %}
120114

121115
{% if author.bitbucket %}
122116
<li>
123-
<a href="https://bitbucket.org/{{ author.bitbucket }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
117+
<a href="https://bitbucket.org/{{ author.bitbucket }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
124118
<i class="fab fa-fw fa-bitbucket" aria-hidden="true"></i><span class="label">Bitbucket</span>
125119
</a>
126120
</li>
127121
{% endif %}
128122

129123
{% if author.github %}
130124
<li>
131-
<a href="https://github.com/{{ author.github }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
125+
<a href="https://github.com/{{ author.github }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
132126
<i class="fab fa-fw fa-github" aria-hidden="true"></i><span class="label">GitHub</span>
133127
</a>
134128
</li>
135129
{% endif %}
136130

137131
{% if author.gitlab %}
138132
<li>
139-
<a href="https://gitlab.com/{{ author.gitlab }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
133+
<a href="https://gitlab.com/{{ author.gitlab }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
140134
<i class="fab fa-fw fa-gitlab" aria-hidden="true"></i><span class="label">GitLab</span>
141135
</a>
142136
</li>
143137
{% endif %}
144138

145139
{% if author.stackoverflow %}
146140
<li>
147-
<a href="https://stackoverflow.com/users/{{ author.stackoverflow }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
141+
<a href="https://stackoverflow.com/users/{{ author.stackoverflow }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
148142
<i class="fab fa-fw fa-stack-overflow" aria-hidden="true"></i><span class="label">Stack Overflow</span>
149143
</a>
150144
</li>
151145
{% endif %}
152146

153147
{% if author.lastfm %}
154148
<li>
155-
<a href="https://last.fm/user/{{ author.lastfm }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
149+
<a href="https://last.fm/user/{{ author.lastfm }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
156150
<i class="fab fa-fw fa-lastfm-square" aria-hidden="true"></i><span class="label">Last.fm</span>
157151
</a>
158152
</li>
159153
{% endif %}
160154

161155
{% if author.dribbble %}
162156
<li>
163-
<a href="https://dribbble.com/{{ author.dribbble }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
157+
<a href="https://dribbble.com/{{ author.dribbble }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
164158
<i class="fab fa-fw fa-dribbble" aria-hidden="true"></i><span class="label">Dribbble</span>
165159
</a>
166160
</li>
167161
{% endif %}
168162

169163
{% if author.pinterest %}
170164
<li>
171-
<a href="https://www.pinterest.com/{{ author.pinterest }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
165+
<a href="https://www.pinterest.com/{{ author.pinterest }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
172166
<i class="fab fa-fw fa-pinterest" aria-hidden="true"></i><span class="label">Pinterest</span>
173167
</a>
174168
</li>
175169
{% endif %}
176170

177171
{% if author.foursquare %}
178172
<li>
179-
<a href="https://foursquare.com/{{ author.foursquare }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
173+
<a href="https://foursquare.com/{{ author.foursquare }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
180174
<i class="fab fa-fw fa-foursquare" aria-hidden="true"></i><span class="label">Foursquare</span>
181175
</a>
182176
</li>
183177
{% endif %}
184178

185179
{% if author.steam %}
186180
<li>
187-
<a href="https://steamcommunity.com/id/{{ author.steam }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
181+
<a href="https://steamcommunity.com/id/{{ author.steam }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
188182
<i class="fab fa-fw fa-steam" aria-hidden="true"></i><span class="label">Steam</span>
189183
</a>
190184
</li>
@@ -193,13 +187,13 @@ <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
193187
{% if author.youtube %}
194188
{% if author.youtube contains "://" %}
195189
<li>
196-
<a href="{{ author.youtube }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
190+
<a href="{{ author.youtube }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
197191
<i class="fab fa-fw fa-youtube" aria-hidden="true"></i><span class="label">YouTube</span>
198192
</a>
199193
</li>
200194
{% elsif author.youtube %}
201195
<li>
202-
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
196+
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
203197
<i class="fab fa-fw fa-youtube" aria-hidden="true"></i><span class="label">YouTube</span>
204198
</a>
205199
</li>
@@ -208,39 +202,39 @@ <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
208202

209203
{% if author.soundcloud %}
210204
<li>
211-
<a href="https://soundcloud.com/{{ author.soundcloud }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
205+
<a href="https://soundcloud.com/{{ author.soundcloud }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
212206
<i class="fab fa-fw fa-soundcloud" aria-hidden="true"></i><span class="label">SoundCloud</span>
213207
</a>
214208
</li>
215209
{% endif %}
216210

217211
{% if author.weibo %}
218212
<li>
219-
<a href="https://www.weibo.com/{{ author.weibo }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
213+
<a href="https://www.weibo.com/{{ author.weibo }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
220214
<i class="fab fa-fw fa-weibo" aria-hidden="true"></i><span class="label">Weibo</span>
221215
</a>
222216
</li>
223217
{% endif %}
224218

225219
{% if author.flickr %}
226220
<li>
227-
<a href="https://www.flickr.com/{{ author.flickr }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
221+
<a href="https://www.flickr.com/{{ author.flickr }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
228222
<i class="fab fa-fw fa-flickr" aria-hidden="true"></i><span class="label">Flickr</span>
229223
</a>
230224
</li>
231225
{% endif %}
232226

233227
{% if author.codepen %}
234228
<li>
235-
<a href="https://codepen.io/{{ author.codepen }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
229+
<a href="https://codepen.io/{{ author.codepen }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
236230
<i class="fab fa-fw fa-codepen" aria-hidden="true"></i><span class="label">CodePen</span>
237231
</a>
238232
</li>
239233
{% endif %}
240234

241235
{% if author.vine %}
242236
<li>
243-
<a href="https://vine.co/u/{{ author.vine }}" itemprop="sameAs" rel="nofollow noopener noreferrer">
237+
<a href="https://vine.co/u/{{ author.vine }}" itemprop="sameAs" rel="nofollow noopener noreferrer me">
244238
<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>
245239
</a>
246240
</li>
@@ -249,4 +243,4 @@ <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
249243
{% include author-profile-custom-links.html %}
250244
</ul>
251245
</div>
252-
</div>
246+
</div>

‎_includes/category-list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<strong><i class="fas fa-fw fa-folder-open" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].categories_label | default: "Categories:" }} </strong>
1313
<span itemprop="keywords">
1414
{% for category_word in categories_sorted %}
15-
<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 %}
15+
<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 %}
1616
{% endfor %}
1717
</span>
1818
</p>

‎_includes/page__date.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
22
{% if page.last_modified_at %}
3-
<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>
3+
<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>
44
{% elsif page.date %}
5-
<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>
6-
{% endif %}
5+
<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>
6+
{% endif %}

‎_includes/tag-list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<strong><i class="fas fa-fw fa-tags" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].tags_label | default: "Tags:" }} </strong>
1313
<span itemprop="keywords">
1414
{% for tag_word in tags_sorted %}
15-
<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 %}
15+
<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 %}
1616
{% endfor %}
1717
</span>
1818
</p>

‎_layouts/single.html

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div id="main" role="main">
1818
{% include sidebar.html %}
1919

20-
<article class="page" itemscope itemtype="https://schema.org/CreativeWork">
20+
<article class="page h-entry" itemscope itemtype="https://schema.org/CreativeWork">
2121
{% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
2222
{% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
2323
{% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date_to_xmlschema }}">{% endif %}
@@ -26,12 +26,14 @@
2626
<div class="page__inner-wrap">
2727
{% unless page.header.overlay_color or page.header.overlay_image %}
2828
<header>
29-
{% if page.title %}<h1 id="page-title" class="page__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>{% endif %}
29+
{% if page.title %}<h1 id="page-title" class="page__title p-name" itemprop="headline">
30+
<a href="{{ page.url | absolute_url }}" class="u-url" itemprop="url">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</a>
31+
</h1>{% endif %}
3032
{% include page__meta.html %}
3133
</header>
3234
{% endunless %}
3335

34-
<section class="page__content" itemprop="text">
36+
<section class="page__content e-content" itemprop="text">
3537
{% if page.toc %}
3638
<aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
3739
<nav class="toc">
@@ -86,4 +88,4 @@ <h2 class="page__related-title">{{ site.data.ui-text[site.locale].related_label
8688
</div>
8789
</div>
8890
{% endif %}
89-
</div>
91+
</div>

‎_sass/minimal-mistakes/_page.scss

+6-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ body {
7272
margin-top: 0;
7373
line-height: 1;
7474

75+
a {
76+
color: $text-color;
77+
text-decoration: none;
78+
}
79+
7580
& + .page__meta {
7681
margin-top: -0.5em;
7782
}
@@ -556,4 +561,4 @@ body {
556561
padding-right: 0;
557562
}
558563
}
559-
}
564+
}

0 commit comments

Comments
 (0)
Please sign in to comment.