File tree 5 files changed +57
-17
lines changed
5 files changed +57
-17
lines changed Original file line number Diff line number Diff line change @@ -174,8 +174,15 @@ collections:
174
174
output : true
175
175
permalink : /projects/:path/
176
176
177
- news_scrollable : true # adds a vertical scroll bar if there are more than 3 news items
178
- news_limit : 5 # leave blank to include all the news in the `_news` folder
177
+ news :
178
+ enabled : true
179
+ scrollable : true # adds a vertical scroll bar if there are more than 3 news items
180
+ limit : 5 # leave blank to include all the news in the `_news` folder
181
+
182
+ latest_posts :
183
+ enabled : true
184
+ scrollable : true # adds a vertical scroll bar if there are more than 3 new posts items
185
+ limit : 3 # leave blank to include all the blog posts
179
186
180
187
# -----------------------------------------------------------------------------
181
188
# Jekyll settings
Original file line number Diff line number Diff line change
1
+
2
+ < div class ="news ">
3
+ {% if site.latest_posts != blank -%}
4
+ {%- assign latest_posts_size = site.posts | size -%}
5
+ < div class ="table-responsive " {% if site.latest_posts.scrollable and latest_posts_size > 3 %}style="max-height: 10vw"{% endif %}>
6
+ < table class ="table table-sm table-borderless ">
7
+ {%- assign latest_posts = site.posts -%}
8
+ {% if site.latest_posts.limit %}
9
+ {% assign latest_posts_limit = site.latest_posts.limit %}
10
+ {% else %}
11
+ {% assign latest_posts_limit = latest_posts_size %}
12
+ {% endif %}
13
+ {% for item in latest_posts limit: latest_posts_limit %}
14
+ < tr >
15
+ < th scope ="row "> {{ item.date | date: "%b %-d, %Y" }}</ th >
16
+ < td >
17
+ < a class ="news-title " href ="{{ item.url | relative_url }} "> {{ item.title }}</ a >
18
+ </ td >
19
+ </ tr >
20
+ {%- endfor %}
21
+ </ table >
22
+ </ div >
23
+ {%- else -%}
24
+ < p > No posts so far...</ p >
25
+ {%- endif %}
26
+ </ div >
Original file line number Diff line number Diff line change 1
-
1
+
2
2
< div class ="news ">
3
- {% if site.news != blank -%}
3
+ {% if site.news != blank -%}
4
4
{%- assign news_size = site.news | size -%}
5
- < div class ="table-responsive " {% if site.news_scrollable and news_size > 3 %}style="max-height: 10vw"{% endif %}>
5
+ < div class ="table-responsive " {% if site.news.scrollable and news_size > 3 %}style="max-height: 10vw"{% endif %}>
6
6
< table class ="table table-sm table-borderless ">
7
7
{%- assign news = site.news | reverse -%}
8
- {% if site.news_limit %}
9
- {% assign news_limit = site.news_limit %}
8
+ {% if site.news.limit %}
9
+ {% assign news_limit = site.news.limit %}
10
10
{% else %}
11
11
{% assign news_limit = news_size %}
12
12
{% endif %}
13
- {% for item in news limit: news_limit %}
13
+ {% for item in news limit: news_limit %}
14
14
< tr >
15
15
< th scope ="row "> {{ item.date | date: "%b %-d, %Y" }}</ th >
16
16
< td >
17
- {% if item.inline -%}
17
+ {% if item.inline -%}
18
18
{{ item.content | remove: '< p > ' | remove: '</ p > ' | emojify }}
19
- {%- else -%}
19
+ {%- else -%}
20
20
< a class ="news-title " href ="{{ item.url | relative_url }} "> {{ item.title }}</ a >
21
- {%- endif %}
21
+ {%- endif %}
22
22
</ td >
23
23
</ tr >
24
- {%- endfor %}
24
+ {%- endfor %}
25
25
</ table >
26
26
</ div >
27
- {%- else -%}
27
+ {%- else -%}
28
28
< p > No news so far...</ p >
29
- {%- endif %}
29
+ {%- endif %}
30
30
</ div >
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ <h1 class="post-title">
23
23
{%- assign profile_image_class = "img-fluid z-depth-1 rounded" -%}
24
24
{% endif %}
25
25
26
- {% include figure.html
27
- path=profile_image_path
26
+ {% include figure.html
27
+ path=profile_image_path
28
28
class=profile_image_class
29
29
alt=page.profile.image -%}
30
30
{% endif -%}
@@ -46,6 +46,12 @@ <h2><a href="{{ '/news/' | relative_url }}" style="color: inherit;">news</a></h2
46
46
{%- include news.html %}
47
47
{%- endif %}
48
48
49
+ <!-- Latest posts -->
50
+ {% if page.latest_posts -%}
51
+ < h2 > < a href ="{{ '/blog/' | relative_url }} " style ="color: inherit; "> latest posts</ a > </ h2 >
52
+ {%- include latest_posts.html %}
53
+ {%- endif %}
54
+
49
55
<!-- Selected papers -->
50
56
{% if page.selected_papers -%}
51
57
< h2 > < a href ="{{ '/publications/' | relative_url }} " style ="color: inherit; "> selected publications</ a > </ h2 >
@@ -62,7 +68,7 @@ <h2><a href="{{ '/publications/' | relative_url }}" style="color: inherit;">sele
62
68
< div class ="contact-note ">
63
69
{{ site.contact_note }}
64
70
</ div >
65
-
71
+
66
72
</ div >
67
73
{%- endif %}
68
74
</ article >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ profile:
14
14
<p>Your City, State 12345</p>
15
15
16
16
news : true # includes a list of news items
17
+ latest_posts : true # includes a list of the newest posts
17
18
selected_papers : true # includes a list of papers marked as "selected={true}"
18
19
social : true # includes social icons at the bottom of the page
19
20
---
You can’t perform that action at this time.
0 commit comments