Skip to content

Commit df4b73f

Browse files
authored
fix: separate blog posts from events (#454)
1 parent 8833c88 commit df4b73f

File tree

6 files changed

+19
-25
lines changed

6 files changed

+19
-25
lines changed

_layouts/posts_events.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ <h2>Upcoming events</h2>
1414
%}
1515

1616
{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture %}
17-
17+
{% assign has_upcoming_events = false %}
1818
{% for post in all_events %}
1919

2020
{% assign start_date = post.event.start_date | date: "%Y-%m-%d" %}
2121
{% capture posttime %}{{ start_date | date: '%s'}}{% endcapture %}
2222

2323
{% if posttime > nowunix %}
24+
{% assign has_upcoming_events = true %}
2425
<div class="upcoming">
2526
{% include event-cards.html %}
2627
</div>
@@ -29,6 +30,11 @@ <h2>Upcoming events</h2>
2930
{% endfor %}
3031

3132

33+
{% if has_upcoming_events == false %}
34+
<p>pyOpenSci doesn't have any events coming up right now. However, check back
35+
to see what we are planning! </p>
36+
{% endif %}
37+
3238
<h2>Past events</h2>
3339

3440
<ul class="taxonomy__index">

_layouts/posts_gallery.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
{{ content }}
66

77
<ul class="taxonomy__index">
8-
{% assign postsInYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
8+
{% assign postsInYear = site.posts
9+
| where_exp: "item", "item.hidden != true"
10+
| where_exp: "item", "item.categories contains 'blog-post'"
11+
| group_by_exp: 'post', 'post.date
12+
| date: "%Y"' %}
913
{% for year in postsInYear %}
1014
<li>
1115
<a href="#{{ year.name }}">

_pages/blog.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,4 @@ header:
1111
author_profile: false
1212
---
1313

14-
## Recent pyOpenSci Posts
15-
<!--
16-
{% comment %}
17-
{% include base_path %}
18-
{% include group-by-array collection=site.posts field="categories" %}
19-
20-
{% for category in group_names %}
21-
{% assign posts = group_items[forloop.index0] %}
22-
<h2 id="{{ category | slugify }}" class="archive__subtitle">{{ category }}</h2>
23-
{% for post in posts %}
24-
{% include archive-single.html %}
25-
{% endfor %}
26-
{% endfor %}
27-
{% endcomment %}
28-
29-
{% include base_path %}
30-
31-
{% for post in site.posts %}
32-
{% include archive-single.html %}
33-
{% endfor %} -->
14+
## Recent pyOpenSci blog posts

_pages/home.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ peer-review:
5555
<img src="/images/people/pyopensci-sprint-pycon-2023.png" alt="Image showing 3 people working at 2 computers during a spring at pyCon USA 2023.">
5656
</div>
5757
<div class="archive__item-body">
58-
<h2 class="archive__item-title">Peer Review Mentorship Program</h2>
58+
<h2 class="archive__item-title">Peer review mentorship program</h2>
5959
<div class="archive__item-excerpt">
6060
<p>We are building diverse community around the scientific packages that drive open science. We recruit and support editors and reviewers from different backgrounds and gender-identities in each review that we perform.
6161
</p>
@@ -81,11 +81,14 @@ peer-review:
8181

8282
<br clear="both">
8383

84+
<!-- pull blog posts not events -->
85+
{% assign blog_posts = site.posts | where_exp: "item", "item.categories contains 'blog-post'" %}
86+
8487
<div class="notice-highlight" markdown="1">
85-
## Recent Blog Posts & Updates
88+
## Recent blog posts & updates
8689

8790
<div class="grid col-3">
88-
{% for post in site.posts limit:3 %}
91+
{% for post in blog_posts limit:3 %}
8992

9093
<div class="cards">
9194
<h3 ><a href="{{ site.baseurl }}{{ post.url}}" rel="permalink">{{ post.title }}</a></h3>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)