You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
1.6 KiB

{% if article is defined %}
{% set card_title = article.title|default('')|trim %}
<div class="card">
<div class="metadata">
{% if category %}
<small>{{ category }}</small>
{% else %}
{% if not is_author_profile %}
<p>by <twig:Molecules:UserFromNpub ident="{{ article.pubkey }}" /></p>
{% endif %}
<small>{{ article.createdAt|date('F j Y') }}</small>
{% endif %}
</div>
<a href="{{ (article.pubkey and npub_from_hex(article.pubkey) != '') ? path('article', { npub: npub_from_hex(article.pubkey), slug: article.slug }) : path('article-legacy-redirect', { slug: article.slug }) }}">
<div class="card-header">
{% if category %}<small class="text-uppercase">{{ category }}</small>{% endif %}
{% if article.image %}
<img src="{{ article.image }}" alt="Cover image for {{ card_title != '' ? card_title : (article.slug|default('')) }}" onerror="this.style.display='none';" >
{% endif %}
</div>
<div class="card-body">
<h2 class="card-title">{% if card_title != '' %}{{ card_title }}{% else %}{{ article.slug|default('')|replace({'-': ' '})|title }}{% endif %}</h2>
{% if article.summary %}
<p class="lede">
{{ article.summary }}
</p>
{% endif %}
</div>
</a>
<div class="card-footer"></div>
</div>
{% endif %}