pages/_includes/news.liquid
Maruan beb6f27d59
format code with prettier.io (#2048)
summary:
- adds prettier formatter configuration
- formats the entire repo using prettier, ignoring minified files
(`*.min.css`) and heavy generated html
- changes extensions of all `.html` files to `.liquid`, which is more
correct and necessary for prettier to work correctly
- replaces "%-" and "-%" with just "%" — manual liquid formatting using
minus signs is superfluous since we are compressing and minifying the
code anyway
- adds CI action for running prettier check on PR and pushes to master
2024-01-10 00:10:51 -05:00

35 lines
1.1 KiB
Plaintext

<div class="news">
{% if site.news != blank %}
{% assign news_size = site.news | size %}
<div
class="table-responsive"
{% if include.limit and site.announcements.scrollable and news_size > 3 %}
style="max-height: 60vw"
{% endif %}
>
<table class="table table-sm table-borderless">
{% assign news = site.news | reverse %}
{% if include.limit and site.announcements.limit %}
{% assign news_limit = site.announcements.limit %}
{% else %}
{% assign news_limit = news_size %}
{% endif %}
{% for item in news limit: news_limit %}
<tr>
<th scope="row" style="width: 20%">{{ item.date | date: '%b %d, %Y' }}</th>
<td>
{% if item.inline %}
{{ item.content | remove: '<p>' | remove: '</p>' | emojify }}
{% else %}
<a class="news-title" href="{{ item.url | relative_url }}">{{ item.title }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
{% else %}
<p>No news so far...</p>
{% endif %}
</div>