Skip to content

Commit 7ad8d79

Browse files
committed
Fix author.youtube conditional in author sidebar
1 parent 9fa1764 commit 7ad8d79

File tree

3 files changed

+28
-25
lines changed

3 files changed

+28
-25
lines changed

_includes/author-profile.html

+14-12
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,20 @@ <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
179179
</li>
180180
{% endif %}
181181

182-
{% if author.youtube contains "://" %}
183-
<li>
184-
<a href="{{ author.youtube }}" itemprop="sameAs">
185-
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
186-
</a>
187-
</li>
188-
{% else %}
189-
<li>
190-
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs">
191-
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
192-
</a>
193-
</li>
182+
{% if author.youtube %}
183+
{% if author.youtube contains "://" %}
184+
<li>
185+
<a href="{{ author.youtube }}" itemprop="sameAs">
186+
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
187+
</a>
188+
</li>
189+
{% else author.youtube %}
190+
<li>
191+
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs">
192+
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
193+
</a>
194+
</li>
195+
{% endif %}
194196
{% endif %}
195197

196198
{% if author.soundcloud %}

docs/_includes/author-profile.html

+14-12
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,20 @@ <h3 class="author__name" itemprop="name">{{ author.name }}</h3>
179179
</li>
180180
{% endif %}
181181

182-
{% if author.youtube contains "://" %}
183-
<li>
184-
<a href="{{ author.youtube }}" itemprop="sameAs">
185-
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
186-
</a>
187-
</li>
188-
{% else %}
189-
<li>
190-
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs">
191-
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
192-
</a>
193-
</li>
182+
{% if author.youtube %}
183+
{% if author.youtube contains "://" %}
184+
<li>
185+
<a href="{{ author.youtube }}" itemprop="sameAs">
186+
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
187+
</a>
188+
</li>
189+
{% else author.youtube %}
190+
<li>
191+
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs">
192+
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
193+
</a>
194+
</li>
195+
{% endif %}
194196
{% endif %}
195197

196198
{% if author.soundcloud %}

test/_config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ author:
109109
youtube : # "https://youtube.com/c/MichaelRoseDesign"
110110

111111

112-
113112
# Reading Files
114113
include:
115114
- .htaccess

0 commit comments

Comments
 (0)