Skip to content

Commit 2215ee5

Browse files
committed
Add include for adding custom author profile links to sidebar
1 parent cc1f09c commit 2215ee5

File tree

5 files changed

+310
-201
lines changed

5 files changed

+310
-201
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
<li>
3+
<a href="http://link-to-whatever-social-network.com/user/" itemprop="sameAs">
4+
<i class="fa fa-fw" aria-hidden="true"></i> Custom Social Profile Link
5+
</a>
6+
</li>
7+
-->

_includes/author-profile.html

Lines changed: 139 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -30,162 +30,204 @@ <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
3030
<ul class="author__urls social-icons">
3131
{% if author.location %}
3232
<li itemprop="homeLocation" itemscope itemtype="http://schema.org/Place">
33-
<i class="fa fa-fw fa-map-marker" aria-hidden="true"></i>
34-
<span itemprop="name"> {{ author.location }} </span>
33+
<i class="fa fa-fw fa-map-marker" aria-hidden="true"></i> <span itemprop="name">{{ author.location }}</span>
3534
</li>
3635
{% endif %}
37-
36+
3837
{% if author.uri %}
3938
<li>
4039
<a href="{{ author.uri }}" itemprop="url">
41-
<i class="fa fa-fw fa-chain" aria-hidden="true"></i>
42-
{{ site.data.ui-text[site.locale].website_label | default: "Website" }}
40+
<i class="fa fa-fw fa-chain" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].website_label | default: "Website" }}
4341
</a>
4442
</li>
4543
{% endif %}
46-
44+
4745
{% if author.email %}
4846
<li>
4947
<a href="mailto:{{ author.email }}">
50-
<i class="fa fa-fw fa-envelope-square" aria-hidden="true"></i>
5148
<meta itemprop="email" content="{{ author.email }}" />
52-
{{ site.data.ui-text[site.locale].email_label | default: "Email" }}
49+
<i class="fa fa-fw fa-envelope-square" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].email_label | default: "Email" }}
5350
</a>
5451
</li>
5552
{% endif %}
56-
53+
5754
{% if author.keybase %}
58-
<li><a href="https://keybase.io/{{ author.keybase }} " itemprop="sameAs">
59-
<i class="fa fa-fw fa-key" aria-hidden="true"></i>
60-
Keybase
61-
</a></li>
55+
<li>
56+
<a href="https://keybase.io/{{ author.keybase }}" itemprop="sameAs">
57+
<i class="fa fa-fw fa-key" aria-hidden="true"></i> Keybase
58+
</a>
59+
</li>
6260
{% endif %}
61+
6362
{% if author.twitter %}
64-
<li><a href="https://twitter.com/{{ author.twitter }}" itemprop="sameAs">
65-
<i class="fa fa-fw fa-twitter-square" aria-hidden="true"></i>
66-
Twitter
67-
</a></li>
63+
<li>
64+
<a href="https://twitter.com/{{ author.twitter }}" itemprop="sameAs">
65+
<i class="fa fa-fw fa-twitter-square" aria-hidden="true"></i> Twitter
66+
</a>
67+
</li>
6868
{% endif %}
69+
6970
{% if author.facebook %}
70-
<li><a href="https://www.facebook.com/{{ author.facebook }}" itemprop="sameAs">
71-
<i class="fa fa-fw fa-facebook-square" aria-hidden="true"></i>
72-
Facebook
73-
</a></li>
71+
<li>
72+
<a href="https://www.facebook.com/{{ author.facebook }}" itemprop="sameAs">
73+
<i class="fa fa-fw fa-facebook-square" aria-hidden="true"></i> Facebook
74+
</a>
75+
</li>
7476
{% endif %}
77+
7578
{% if author.google_plus %}
76-
<li><a href="https://plus.google.com/+{{ author.google_plus }}" itemprop="sameAs">
77-
<i class="fa fa-fw fa-google-plus-square" aria-hidden="true"></i>
78-
Google+
79-
</a></li>
79+
<li>
80+
<a href="https://plus.google.com/+{{ author.google_plus }}" itemprop="sameAs">
81+
<i class="fa fa-fw fa-google-plus-square" aria-hidden="true"></i> Google+
82+
</a>
83+
</li>
8084
{% endif %}
85+
8186
{% if author.linkedin %}
82-
<li><a href="https://www.linkedin.com/in/{{ author.linkedin }}" itemprop="sameAs">
83-
<i class="fa fa-fw fa-linkedin-square" aria-hidden="true"></i>
84-
LinkedIn
85-
</a></li>
87+
<li>
88+
<a href="https://www.linkedin.com/in/{{ author.linkedin }}" itemprop="sameAs">
89+
<i class="fa fa-fw fa-linkedin-square" aria-hidden="true"></i> LinkedIn
90+
</a>
91+
</li>
8692
{% endif %}
93+
8794
{% if author.xing %}
88-
<li><a href="https://www.xing.com/profile/{{ author.xing }}" itemprop="sameAs">
89-
<i class="fa fa-fw fa-xing-square" aria-hidden="true"></i>
90-
XING
91-
</a></li>
95+
<li>
96+
<a href="https://www.xing.com/profile/{{ author.xing }}" itemprop="sameAs">
97+
<i class="fa fa-fw fa-xing-square" aria-hidden="true"></i> XING
98+
</a>
99+
</li>
92100
{% endif %}
101+
93102
{% if author.instagram %}
94-
<li><a href="https://instagram.com/{{ author.instagram }}" itemprop="sameAs">
95-
<i class="fa fa-fw fa-instagram" aria-hidden="true"></i>
96-
Instagram
97-
</a></li>
103+
<li>
104+
<a href="https://instagram.com/{{ author.instagram }}" itemprop="sameAs">
105+
<i class="fa fa-fw fa-instagram" aria-hidden="true"></i> Instagram
106+
</a>
107+
</li>
98108
{% endif %}
109+
99110
{% if author.tumblr %}
100-
<li><a href="https://{{ author.tumblr }}.tumblr.com" itemprop="sameAs">
101-
<i class="fa fa-fw fa-tumblr-square" aria-hidden="true"></i>
102-
Tumblr
103-
</a></li>
111+
<li>
112+
<a href="https://{{ author.tumblr }}.tumblr.com" itemprop="sameAs">
113+
<i class="fa fa-fw fa-tumblr-square" aria-hidden="true"></i> Tumblr
114+
</a>
115+
</li>
104116
{% endif %}
117+
105118
{% if author.bitbucket %}
106-
<li><a href="https://bitbucket.org/{{ author.bitbucket }}" itemprop="sameAs">
107-
<i class="fa fa-fw fa-bitbucket" aria-hidden="true"></i>
108-
Bitbucket
109-
</a></li>
119+
<li>
120+
<a href="https://bitbucket.org/{{ author.bitbucket }}" itemprop="sameAs">
121+
<i class="fa fa-fw fa-bitbucket" aria-hidden="true"></i> Bitbucket
122+
</a>
123+
</li>
110124
{% endif %}
125+
111126
{% if author.github %}
112-
<li><a href="https://github.com/{{ author.github }}" itemprop="sameAs">
113-
<i class="fa fa-fw fa-github" aria-hidden="true"></i>
114-
Github
115-
</a></li>
127+
<li>
128+
<a href="https://github.com/{{ author.github }}" itemprop="sameAs">
129+
<i class="fa fa-fw fa-github" aria-hidden="true"></i> GitHub
130+
</a>
131+
</li>
116132
{% endif %}
133+
117134
{% if author.stackoverflow %}
118-
<li><a href="https://www.stackoverflow.com/users/{{ author.stackoverflow }}" itemprop="sameAs">
119-
<i class="fa fa-fw fa-stack-overflow" aria-hidden="true"></i>
120-
Stackoverflow
121-
</a></li>
135+
<li>
136+
<a href="https://www.stackoverflow.com/users/{{ author.stackoverflow }}" itemprop="sameAs">
137+
<i class="fa fa-fw fa-stack-overflow" aria-hidden="true"></i> Stackoverflow
138+
</a>
139+
</li>
122140
{% endif %}
141+
123142
{% if author.lastfm %}
124-
<li><a href="https://last.fm/user/{{ author.lastfm }}" itemprop="sameAs">
125-
<i class="fa fa-fw fa-lastfm-square" aria-hidden="true"></i>
126-
Last.fm
127-
</a></li>
143+
<li>
144+
<a href="https://last.fm/user/{{ author.lastfm }}" itemprop="sameAs">
145+
<i class="fa fa-fw fa-lastfm-square" aria-hidden="true"></i> Last.fm
146+
</a>
147+
</li>
128148
{% endif %}
149+
129150
{% if author.dribbble %}
130-
<li><a href="https://dribbble.com/{{ author.dribbble }}" itemprop="sameAs">
131-
<i class="fa fa-fw fa-dribbble" aria-hidden="true"></i>
132-
Dribbble
133-
</a></li>
151+
<li>
152+
<a href="https://dribbble.com/{{ author.dribbble }}" itemprop="sameAs">
153+
<i class="fa fa-fw fa-dribbble" aria-hidden="true"></i> Dribbble
154+
</a>
155+
</li>
134156
{% endif %}
157+
135158
{% if author.pinterest %}
136-
<li><a href="https://www.pinterest.com/{{ author.pinterest }}" itemprop="sameAs">
137-
<i class="fa fa-fw fa-pinterest" aria-hidden="true"></i>
138-
Pinterest
139-
</a></li>
159+
<li>
160+
<a href="https://www.pinterest.com/{{ author.pinterest }}" itemprop="sameAs">
161+
<i class="fa fa-fw fa-pinterest" aria-hidden="true"></i> Pinterest
162+
</a>
163+
</li>
140164
{% endif %}
165+
141166
{% if author.foursquare %}
142-
<li><a href="https://foursquare.com/{{ author.foursquare }}" itemprop="sameAs">
143-
<i class="fa fa-fw fa-foursquare" aria-hidden="true"></i>
144-
Foursquare
145-
</a></li>
167+
<li>
168+
<a href="https://foursquare.com/{{ author.foursquare }}" itemprop="sameAs">
169+
<i class="fa fa-fw fa-foursquare" aria-hidden="true"></i> Foursquare
170+
</a>
171+
</li>
146172
{% endif %}
173+
147174
{% if author.steam %}
148-
<li><a href="https://steamcommunity.com/id/{{ author.steam }}" itemprop="sameAs">
149-
<i class="fa fa-fw fa-steam-square" aria-hidden="true"></i>
150-
Steam
151-
</a></li>
175+
<li>
176+
<a href="https://steamcommunity.com/id/{{ author.steam }}" itemprop="sameAs">
177+
<i class="fa fa-fw fa-steam-square" aria-hidden="true"></i> Steam
178+
</a>
179+
</li>
152180
{% endif %}
181+
153182
{% if author.youtube %}
154-
<li><a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs">
155-
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i>
156-
YouTube
157-
</a></li>
183+
<li>
184+
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs">
185+
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
186+
</a>
187+
</li>
158188
{% endif %}
189+
159190
{% if author.soundcloud %}
160-
<li><a href="https://soundcloud.com/{{ author.soundcloud }}" itemprop="sameAs">
161-
<i class="fa fa-fw fa-soundcloud" aria-hidden="true"></i>
162-
Soundcloud
163-
</a></li>
191+
<li>
192+
<a href="https://soundcloud.com/{{ author.soundcloud }}" itemprop="sameAs">
193+
<i class="fa fa-fw fa-soundcloud" aria-hidden="true"></i> Soundcloud
194+
</a>
195+
</li>
164196
{% endif %}
197+
165198
{% if author.weibo %}
166-
<li><a href="https://www.weibo.com/{{ author.weibo }}" itemprop="sameAs">
167-
<i class="fa fa-fw fa-weibo" aria-hidden="true"></i>
168-
Weibo
169-
</a></li>
199+
<li>
200+
<a href="https://www.weibo.com/{{ author.weibo }}" itemprop="sameAs">
201+
<i class="fa fa-fw fa-weibo" aria-hidden="true"></i> Weibo
202+
</a>
203+
</li>
170204
{% endif %}
205+
171206
{% if author.flickr %}
172-
<li><a href="https://www.flickr.com/{{ author.flickr }}" itemprop="sameAs">
173-
<i class="fa fa-fw fa-flickr" aria-hidden="true"></i>
174-
Flickr
175-
</a></li>
207+
<li>
208+
<a href="https://www.flickr.com/{{ author.flickr }}" itemprop="sameAs">
209+
<i class="fa fa-fw fa-flickr" aria-hidden="true"></i> Flickr
210+
</a>
211+
</li>
176212
{% endif %}
213+
177214
{% if author.codepen %}
178-
<li><a href="https://codepen.io/{{ author.codepen }}" itemprop="sameAs">
179-
<i class="fa fa-fw fa-codepen" aria-hidden="true"></i>
180-
CodePen
181-
</a></li>
215+
<li>
216+
<a href="https://codepen.io/{{ author.codepen }}" itemprop="sameAs">
217+
<i class="fa fa-fw fa-codepen" aria-hidden="true"></i> CodePen
218+
</a>
219+
</li>
182220
{% endif %}
221+
183222
{% if author.vine %}
184-
<li><a href="https://vine.co/u/{{ author.vine }}" itemprop="sameAs">
185-
<i class="fa fa-fw fa-vine" aria-hidden="true"></i>
186-
Vine
187-
</a></li>
223+
<li>
224+
<a href="https://vine.co/u/{{ author.vine }}" itemprop="sameAs">
225+
<i class="fa fa-fw fa-vine" aria-hidden="true"></i> Vine
226+
</a>
227+
</li>
188228
{% endif %}
229+
230+
{% include author-profile-custom-links.html %}
189231
</ul>
190232
</div>
191233
</div>

docs/_docs/10-layouts.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ single_layout_gallery:
77
alt: "single layout with header example"
88
- image_path: /assets/images/mm-layout-single-meta.png
99
alt: "single layout with comments and related posts"
10-
modified: 2016-10-06T23:02:37-04:00
10+
modified: 2016-12-12T15:20:20-05:00
1111
---
1212

1313
{% include toc icon="columns" title="Included Layouts" %}
@@ -333,16 +333,19 @@ defaults:
333333

334334
The theme comes pre-built with a selection of links for the most common social media networks. These are all optional and can be [assigned in `_config.yml`]({{ "/docs/configuration/" | absolute_url }}).
335335

336-
To add more links you'll need to crack open [`_includes/author-profile.html`](https://github.com/mmistakes/minimal-mistakes/blob/master/_includes/author-profile.html) and make some edits.
336+
To add more links you'll need to crack open [`_includes/author-profile-custom-links.html`](https://github.com/mmistakes/minimal-mistakes/blob/master/_includes/author-profile-custom-links.html) and add the appropriate `<li>` markup shown below.
337337

338-
Inside of `<ul class="author__urls">` you'll find `<li>` elements wrapped in Liquid conditionals. These represent each of the possible links you can currently add to the sidebar.
338+
**Please note:** Links added here will appear after the ones in [`_includes/author-profile.html`](https://github.com/mmistakes/minimal-mistakes/blob/master/_includes/author-profile.html). If you'd like to change the order of appearance you'll need to edit that file directly.
339+
{: .notice--info}
339340

340-
#### Example of Twitter link
341+
#### Social network link example
341342

342343
```html
343-
{% raw %}{% if author.twitter %}
344-
<li><a href="https://twitter.com/{{ author.twitter }}"><i class="fa fa-fw fa-twitter-square" aria-hidden="true"></i> Twitter</a></li>
345-
{% endif %}{% endraw %}
344+
<li>
345+
<a href="https://whatever-social-network.com/username">
346+
<i class="fa fa-fw" aria-hidden="true"></i> Awesome Social Network
347+
</a>
348+
</li>
346349
```
347350

348351
To add a new link you'll need three things:
@@ -351,7 +354,7 @@ To add a new link you'll need three things:
351354
2. [Font Awesome icon](http://fontawesome.io/icons/) (`fa-` class)
352355
3. Label for the link
353356

354-
It's up to you if you want to wrap it in a `{% raw %}{% if %} ... {% endif %}{% endraw %}`conditional and add variables to `_config.yml`. If you don't plan to change it then hard-coding the strings is perfectly acceptable.
357+
It's up to you if you want to wrap it in a `{% raw %}{% if %} ... {% endif %}{% endraw %}`conditional and add a variable to `_config.yml`. If you don't plan to change it then hard-coding the string is perfectly acceptable.
355358

356359
Let's run through how you'd add a new link that points to a Reddit profile. Starting with the three things from above:
357360

@@ -362,13 +365,21 @@ Let's run through how you'd add a new link that points to a Reddit profile. Star
362365
And plug them into the appropriate locations:
363366

364367
```html
365-
<li><a href="[1]"><i class="fa fa-fw [2]" aria-hidden="true"></i> [3]</a></li>
368+
<li>
369+
<a href="[1]">
370+
<i class="fa fa-fw [2]" aria-hidden="true"></i> [3]
371+
</a>
372+
</li>
366373
```
367374

368375
To end up with:
369376

370377
```html
371-
<li><a href="https://www.reddit.com/user/username"><i class="fa fa-fw fa-reddit" aria-hidden="true"></i> Reddit</a></li>
378+
<li>
379+
<a href="https://www.reddit.com/user/username">
380+
<i class="fa fa-fw fa-reddit" aria-hidden="true"></i> Reddit
381+
</a>
382+
</li>
372383
```
373384

374385
![Reddit link in author profile]({{ "/assets/images/mm-author-profile-reddit-gs.png" | absolute_url }})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
<li>
3+
<a href="http://link-to-whatever-social-network.com/user/" itemprop="sameAs">
4+
<i class="fa fa-fw" aria-hidden="true"></i> Custom Social Profile Link
5+
</a>
6+
</li>
7+
-->

0 commit comments

Comments
 (0)