Implemented latest posts on about page (#1307)
Adresses #340 --------- Signed-off-by: George Araújo <george.gcac@gmail.com>
This commit is contained in:
parent
5ff54a74ef
commit
60209cfd93
11
_config.yml
11
_config.yml
|
|
@ -174,8 +174,15 @@ collections:
|
||||||
output: true
|
output: true
|
||||||
permalink: /projects/:path/
|
permalink: /projects/:path/
|
||||||
|
|
||||||
news_scrollable: true # adds a vertical scroll bar if there are more than 3 news items
|
news:
|
||||||
news_limit: 5 # leave blank to include all the news in the `_news` folder
|
enabled: true
|
||||||
|
scrollable: true # adds a vertical scroll bar if there are more than 3 news items
|
||||||
|
limit: 5 # leave blank to include all the news in the `_news` folder
|
||||||
|
|
||||||
|
latest_posts:
|
||||||
|
enabled: true
|
||||||
|
scrollable: true # adds a vertical scroll bar if there are more than 3 new posts items
|
||||||
|
limit: 3 # leave blank to include all the blog posts
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Jekyll settings
|
# Jekyll settings
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
<div class="news">
|
||||||
|
{% if site.latest_posts != blank -%}
|
||||||
|
{%- assign latest_posts_size = site.posts | size -%}
|
||||||
|
<div class="table-responsive" {% if site.latest_posts.scrollable and latest_posts_size > 3 %}style="max-height: 10vw"{% endif %}>
|
||||||
|
<table class="table table-sm table-borderless">
|
||||||
|
{%- assign latest_posts = site.posts -%}
|
||||||
|
{% if site.latest_posts.limit %}
|
||||||
|
{% assign latest_posts_limit = site.latest_posts.limit %}
|
||||||
|
{% else %}
|
||||||
|
{% assign latest_posts_limit = latest_posts_size %}
|
||||||
|
{% endif %}
|
||||||
|
{% for item in latest_posts limit: latest_posts_limit %}
|
||||||
|
<tr>
|
||||||
|
<th scope="row">{{ item.date | date: "%b %-d, %Y" }}</th>
|
||||||
|
<td>
|
||||||
|
<a class="news-title" href="{{ item.url | relative_url }}">{{ item.title }}</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{%- endfor %}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{%- else -%}
|
||||||
|
<p>No posts so far...</p>
|
||||||
|
{%- endif %}
|
||||||
|
</div>
|
||||||
|
|
@ -1,30 +1,30 @@
|
||||||
|
|
||||||
<div class="news">
|
<div class="news">
|
||||||
{% if site.news != blank -%}
|
{% if site.news != blank -%}
|
||||||
{%- assign news_size = site.news | size -%}
|
{%- assign news_size = site.news | size -%}
|
||||||
<div class="table-responsive" {% if site.news_scrollable and news_size > 3 %}style="max-height: 10vw"{% endif %}>
|
<div class="table-responsive" {% if site.news.scrollable and news_size > 3 %}style="max-height: 10vw"{% endif %}>
|
||||||
<table class="table table-sm table-borderless">
|
<table class="table table-sm table-borderless">
|
||||||
{%- assign news = site.news | reverse -%}
|
{%- assign news = site.news | reverse -%}
|
||||||
{% if site.news_limit %}
|
{% if site.news.limit %}
|
||||||
{% assign news_limit = site.news_limit %}
|
{% assign news_limit = site.news.limit %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% assign news_limit = news_size %}
|
{% assign news_limit = news_size %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for item in news limit: news_limit %}
|
{% for item in news limit: news_limit %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ item.date | date: "%b %-d, %Y" }}</th>
|
<th scope="row">{{ item.date | date: "%b %-d, %Y" }}</th>
|
||||||
<td>
|
<td>
|
||||||
{% if item.inline -%}
|
{% if item.inline -%}
|
||||||
{{ item.content | remove: '<p>' | remove: '</p>' | emojify }}
|
{{ item.content | remove: '<p>' | remove: '</p>' | emojify }}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
<a class="news-title" href="{{ item.url | relative_url }}">{{ item.title }}</a>
|
<a class="news-title" href="{{ item.url | relative_url }}">{{ item.title }}</a>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
<p>No news so far...</p>
|
<p>No news so far...</p>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ layout: default
|
||||||
{%- assign profile_image_class = "img-fluid z-depth-1 rounded" -%}
|
{%- assign profile_image_class = "img-fluid z-depth-1 rounded" -%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% include figure.html
|
{% include figure.html
|
||||||
path=profile_image_path
|
path=profile_image_path
|
||||||
class=profile_image_class
|
class=profile_image_class
|
||||||
alt=page.profile.image -%}
|
alt=page.profile.image -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
@ -46,6 +46,12 @@ layout: default
|
||||||
{%- include news.html %}
|
{%- include news.html %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
<!-- Latest posts -->
|
||||||
|
{% if page.latest_posts -%}
|
||||||
|
<h2><a href="{{ '/blog/' | relative_url }}" style="color: inherit;">latest posts</a></h2>
|
||||||
|
{%- include latest_posts.html %}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
<!-- Selected papers -->
|
<!-- Selected papers -->
|
||||||
{% if page.selected_papers -%}
|
{% if page.selected_papers -%}
|
||||||
<h2><a href="{{ '/publications/' | relative_url }}" style="color: inherit;">selected publications</a></h2>
|
<h2><a href="{{ '/publications/' | relative_url }}" style="color: inherit;">selected publications</a></h2>
|
||||||
|
|
@ -62,7 +68,7 @@ layout: default
|
||||||
<div class="contact-note">
|
<div class="contact-note">
|
||||||
{{ site.contact_note }}
|
{{ site.contact_note }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</article>
|
</article>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ profile:
|
||||||
<p>Your City, State 12345</p>
|
<p>Your City, State 12345</p>
|
||||||
|
|
||||||
news: true # includes a list of news items
|
news: true # includes a list of news items
|
||||||
|
latest_posts: true # includes a list of the newest posts
|
||||||
selected_papers: true # includes a list of papers marked as "selected={true}"
|
selected_papers: true # includes a list of papers marked as "selected={true}"
|
||||||
social: true # includes social icons at the bottom of the page
|
social: true # includes social icons at the bottom of the page
|
||||||
---
|
---
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue