Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/_includes/bio.njk
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
</div>

<div class="space-y-4 text-sm border-t border-[var(--border-color)] pt-6">
{% if location or country %}
<div class="flex items-center gap-3">
<span class="text-lg">📍</span>
<span class="text-[var(--text-muted)]">{{ location }}{% if country %}, {{ country }}{% endif %}</span>
<span class="text-[var(--text-muted)]">{{ location }}{% if location and country %}, {% endif %}{{ country }}</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for displaying the location and country can be simplified and made more robust by using the join filter. This ensures that the comma and space are only added when both values are present, and it handles potential whitespace issues more cleanly if combined with trim.

              <span class="text-[var(--text-muted)]">{{ [location, country] | select | join(', ') }}</span>

</div>
{% endif %}

{% if email %}
<div class="flex items-center gap-3 group cursor-pointer" onclick="copyToClipboard('{{ email }}', this)">
Expand Down Expand Up @@ -72,6 +74,7 @@
</div>

<div class="lg:col-span-2 space-y-8">
{% if bio %}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To prevent rendering an empty card if the bio field contains only whitespace (e.g., from a YAML block scalar with only newlines), it is safer to check if the trimmed content is truthy.

        {% if bio | trim %}

<div class="user-card p-8 sm:p-12 rounded-3xl">
<h2 class="text-xs font-black uppercase tracking-[0.3em] text-[var(--text-muted)] mb-6 flex items-center gap-2">
<span class="w-8 h-[2px] bg-accent"></span> Professional Bio
Expand All @@ -80,6 +83,7 @@
{{ bio }}
</div>
</div>
{% endif %}

{% if languages is defined and languages is not null %}
<div class="user-card p-8 rounded-3xl">
Expand Down
2 changes: 0 additions & 2 deletions src/users/jbampton.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: John Bampton 🏂 🏄 🎿 ♠️ ♥️ ♣️ ♦️ 💎 🏆 😎 🎀
github: jbampton
website: https://john.onelang.workers.dev/
email: jbampton@gmail.com
country: Australia
location: Brisbane
role: Technical Manager and Scrum Master
Expand Down
Loading