Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add news page #1085

Merged
merged 4 commits into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _includes/news.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div class="news">
<h2>news</h2>
<h2><a href="{{ '/news/' | relative_url }}" style="color: inherit;">news</a></h2>
{% if site.news != blank -%}
{%- assign news_size = site.news | size -%}
<div class="table-responsive" {% if site.news_scrollable and news_size > 3 %}style="max-height: 10vw"{% endif %}>
Expand Down
2 changes: 1 addition & 1 deletion _includes/selected_papers.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="publications">
<h2>selected publications</h2>
<h2><a href="{{ '/publications/' | relative_url }}" style="color: inherit;">selected publications</a></h2>
{% bibliography -f papers -q @*[selected=true]* %}
</div>
35 changes: 35 additions & 0 deletions _layouts/news.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: page
---


<div class="news">
{% if site.news != blank -%}
{%- assign news_size = site.news | size -%}
<div class="table-responsive" {% if site.news_scrollable and news_size > 3 %}style="max-height: 10vw"{% endif %}>
<table class="table table-sm table-borderless">
{%- assign news = site.news | reverse -%}
{% if site.news_limit %}
{% assign news_limit = site.news_limit %}
{% else %}
{% assign news_limit = news_size %}
{% endif %}
{% for item in news limit: news_limit %}
<tr>
<th scope="row">{{ 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>
rohandebsarkar marked this conversation as resolved.
Show resolved Hide resolved

5 changes: 5 additions & 0 deletions _pages/news.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: news
title: news
permalink: /news/
---
rohandebsarkar marked this conversation as resolved.
Show resolved Hide resolved