{% load i18n %}

<a id="{{ attachment.get_html_id }}" class="card-title" href="{{ attachment.get_absolute_url }}" title="{{ attachment.name }}">
  <i class="fa fa-paperclip" aria-hidden="true"></i>
  {{ attachment.name|truncatechars:25 }}
  <span class="badge badge-light">
    {{ attachment.size|filesizeformat }}
  </span>
</a>

{% load i18n %}

<a id="{{ attachment.get_html_id }}" class="card-title" href="{{ attachment.get_absolute_url }}" title="{{ attachment.name }}">
  <i class="fa fa-paperclip" aria-hidden="true"></i>
  {{ attachment.name|truncatechars:25 }}
</a>
<span class="badge badge-light">
  {{ attachment.size|filesizeformat }}
</span>

Move filesize badge out of link
Move filesize badge out of link