{{ $achievementImage := resources.Get .image }}
{{ $achievementImageLg := ""}}
{{ $achievementImageSm := ""}}

{{/* resize the images. don't resize svg image because its not supported */}}
{{ if $achievementImage }}
  {{ $achievementImageSm = $achievementImage.Resize "x300" }}
  {{ $achievementImageSm =  $achievementImageSm.RelPermalink }}
  {{ $achievementImageLg = $achievementImage.Resize "x1500" }}
  {{ $achievementImageLg =  $achievementImageLg.RelPermalink }}
{{ end }}
{{/*  don't use "background-image: url('{{ $achievementImageSm }}');" Otherwise the images won't show in https://themes.gohugo.io/ */}}
<div 
  class="achievement-entry text-center"
  style="background-image: url('{{ $achievementImageSm }}');"
>
  <i class="fas fa-search-plus" id="enlarge-icon"></i>
  <h4 class="title" id="achievement-title">{{ .title }}</h4>
  <div class="caption hidden col-lg-6 text-left" id="caption">
    <h4>{{ .title }}</h4>
    <p>{{ .summary | markdownify }}</p>
    {{ if .url }}
      <a class="btn btn-info ml-1 pl-2 mb-2" href="{{ .url }}" target="_blank" rel="noopener" role="button">{{ i18n "project_details"}}</a>
    {{ end }}
  </div>
  <span style="background-image: url('{{ $achievementImageSm }}');" class="d-none" id="SmallImage" active="true"></span>
<span  style="background-image: url('{{ $achievementImageLg }}');" class="d-none" id="LargeImage"></span>
</div>
