Skip to content

Commit

Permalink
Added a News menu
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhyungyang committed Dec 10, 2024
1 parent 47bc48f commit 2020c54
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
41 changes: 22 additions & 19 deletions _includes/news.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@
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 %}
<table style="table">
{% 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%; vertical-align: top;"><a href="{{ item.url | relative_url }}">{{ item.date | date: '%b %d, %Y' }}</a></th>
<td>
{% if page.name == "about.md" %}
<a class="news-title" href="{{ item.url | relative_url }}">{{ item.title }}</a>
{% else %}
<div style="text-align: left;">
<a class="news-title" href="{{ item.url | relative_url }}">{{ item.title }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{{ item.content | emojify }}
</div>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
{% else %}
<p>No news so far...</p>
Expand Down
4 changes: 3 additions & 1 deletion _pages/news.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
layout: page
title: news
title: News
permalink: /news/
nav: true
nav_order: 1
---

{% include news.liquid %}

0 comments on commit 2020c54

Please sign in to comment.