Skip to content

Instantly share code, notes, and snippets.

@osama2kabdullah
Created December 24, 2023 04:27
Show Gist options
  • Save osama2kabdullah/af0d2d42a2182d9fc43a987e8ddac174 to your computer and use it in GitHub Desktop.
Save osama2kabdullah/af0d2d42a2182d9fc43a987e8ddac174 to your computer and use it in GitHub Desktop.
The condition about show the date of article and comment.
{% if section.settings.show_date %}
<div class="card-footer">
<div class="d-flex justify-content-between">
<small class="text-muted">{{ article.published_at | date: '%B %d, %Y' }}</small>
{% if article.comments_count > 0 %}
<small>{{ article.comments_count }} Comments</small>
{% endif %}
</div>
</div>
{% else %}
{% if article.comments_count > 0 %}
<div class="card-footer">
<div class="d-flex justify-content-between">
<small>{{ article.comments_count }} Comments</small>
</div>
</div>
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment