Skip to content

Commit

Permalink
Show home news reversed by date
Browse files Browse the repository at this point in the history
  • Loading branch information
hamoid committed Feb 5, 2025
1 parent 97159ec commit 0950de0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions _includes/figure.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
<img src="{{ include.src | relative_url }}" alt="{{ include.title }}" title="{{ include.title }}">
<figcaption>{{ include.title }}</figcaption>
</figure>

2 changes: 1 addition & 1 deletion _layouts/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2 class="text-sm my-2">{{ page.subtitle }}<br>{{ date_string }}</h2>
{% if page.images%}
<div class="grid grid-flow-row sm:grid-cols-2 lg:grid-cols-3 justify-center gap-2">
{% for image in page.images %}
{% include figure.html src=image.file title=image.caption%}
{% include figure.html src=image.image title=image.caption%}
{% endfor %}
</div>
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ <h2 class="text-left mt-2">{{ page.subtitle }}</h2>

<h1>news</h1>
<div class="flex flex-col items-center links-without-underline">
{% for news_item in site.news limit:2 %}
{% assign items = site.news | sort: 'publish_date' | reverse %}
{% for news_item in items limit:2 %}
<a href="{{ news_item.url | relative_url }}">
<div class="m-8 md:w-[760px] text-lg border-r-8 border-white hover:border-lime-500 transition-colors duration-300">
<h2>{{ news_item.title }}</h2>
Expand Down
4 changes: 2 additions & 2 deletions _layouts/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ <h2 class="text-sm my-2">{{ page.subtitle }}<br>{{ page.publish_date | date: "%d

{% if page.images%}
<div class="grid grid-flow-row sm:grid-cols-2 lg:grid-cols-3 justify-center gap-2">
{% for image in page.images %}
{% include figure.html src=image.file title=image.caption %}
{% for img in page.images %}
{% include figure.html src=img.image title=img.caption %}
{% endfor %}
</div>
{% endif %}
Expand Down

0 comments on commit 0950de0

Please sign in to comment.