Skip to content

Commit

Permalink
feat(flag): Add flag download link
Browse files Browse the repository at this point in the history
  • Loading branch information
mvsde committed Feb 29, 2024
1 parent e249466 commit a9762a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion components/search.njk
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@
data-patterns="{{ flag.patterns }}"
>
{% set width = 178 %}
{% set height = (width / flag.aspectRatio)|round %}
{% set descriptionID = id ~ "-flag-description" %}
<img
class="Search-itemFlag"
src="/img/{{ id }}.svg"
alt="{{ flag.name }} flag"
width="{{ width }}"
height="{{ (width / flag.aspectRatio)|round }}"
height="{{ height }}"
loading="lazy"
aria-describedby="{{ descriptionID }}"
>
Expand Down
21 changes: 14 additions & 7 deletions pages/flag.njk
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@
<section>
<h2>Flag</h2>

{% set width = 300 %}
<img
src="/img/{{ id }}.svg"
alt="{{ flag.name }} flag. {{ flag.alt }}"
width="{{ width }}"
height="{{ (width / flag.aspectRatio)|round }}"
>
<p>
{% set width = 300 %}
{% set height = (width / flag.aspectRatio)|round %}
<img
src="/img/{{ id }}.svg"
alt="{{ flag.name }} flag. {{ flag.alt }}"
width="{{ width }}"
height="{{ height }}"
>
</p>

<p>
<a href="/img/{{ id }}.svg" download="{{ flag.name }}">Download flag</a>
</p>
</section>

{% if flag.links %}
Expand Down

0 comments on commit a9762a1

Please sign in to comment.