Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
12 changes: 0 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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,14 @@
</div>

<div class="space-y-4 text-sm border-t border-[var(--border-color)] pt-6">
{% if location %}
<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)]">
{% if location and country %}{{ location }}, {{ country }}{% elif location %}{{ location }}{% endif %}
</span>
</div>
{% endif %}
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 has been made unnecessarily complex and introduces potential UI issues due to whitespace handling.

  1. Redundancy: The nested if/elif checks for location are redundant because the entire block is already guarded by {% if location %}. The previous logic was more concise and readable.
  2. Whitespace Sensitivity: In HTML, newlines and indentation inside a <span> are rendered as spaces. The current multi-line structure will likely result in unwanted leading and trailing whitespace around the location text.
  3. Consistency: It is recommended to use | trim to ensure that strings containing only whitespace are correctly identified as empty, matching the logic applied in src/index.njk.
            {% if location and location | trim %}
            <div class="flex items-center gap-3">
              <span class="text-lg">📍</span>
              <span class="text-[var(--text-muted)]">{{ location }}{% if country %}, {{ country }}{% endif %}</span>
            </div>
            {% endif %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed, please fix it.


{% if email %}
<div class="flex items-center gap-3 group cursor-pointer" onclick="copyToClipboard('{{ email }}', this)">
Expand Down
2 changes: 1 addition & 1 deletion src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ layout: false
<p class="text-accent font-semibold text-sm uppercase tracking-wider">{{ person.data.role }}</p>
</div>
{% set location = person.data.location %}
{% if location %}
{% if location and location | trim %}
<span class="shrink-0 text-[10px] bg-[var(--bg-footer)] text-[var(--text-muted)] px-2 py-1 rounded font-bold uppercase border border-[var(--border-color)]">
{{ location }}
</span>
Expand Down