Skip to content

Commit

Permalink
fix: separate blog posts from events (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasser committed Aug 1, 2024
1 parent 8833c88 commit df4b73f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
8 changes: 7 additions & 1 deletion _layouts/posts_events.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ <h2>Upcoming events</h2>
%}

{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture %}

{% assign has_upcoming_events = false %}
{% for post in all_events %}

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

{% if posttime > nowunix %}
{% assign has_upcoming_events = true %}
<div class="upcoming">
{% include event-cards.html %}
</div>
Expand All @@ -29,6 +30,11 @@ <h2>Upcoming events</h2>
{% endfor %}


{% if has_upcoming_events == false %}
<p>pyOpenSci doesn't have any events coming up right now. However, check back
to see what we are planning! </p>
{% endif %}

<h2>Past events</h2>

<ul class="taxonomy__index">
Expand Down
6 changes: 5 additions & 1 deletion _layouts/posts_gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
{{ content }}

<ul class="taxonomy__index">
{% assign postsInYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
{% assign postsInYear = site.posts
| where_exp: "item", "item.hidden != true"
| where_exp: "item", "item.categories contains 'blog-post'"
| group_by_exp: 'post', 'post.date
| date: "%Y"' %}
{% for year in postsInYear %}
<li>
<a href="#{{ year.name }}">
Expand Down
21 changes: 1 addition & 20 deletions _pages/blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,4 @@ header:
author_profile: false
---

## Recent pyOpenSci Posts
<!--
{% comment %}
{% include base_path %}
{% include group-by-array collection=site.posts field="categories" %}
{% for category in group_names %}
{% assign posts = group_items[forloop.index0] %}
<h2 id="{{ category | slugify }}" class="archive__subtitle">{{ category }}</h2>
{% for post in posts %}
{% include archive-single.html %}
{% endfor %}
{% endfor %}
{% endcomment %}
{% include base_path %}
{% for post in site.posts %}
{% include archive-single.html %}
{% endfor %} -->
## Recent pyOpenSci blog posts
9 changes: 6 additions & 3 deletions _pages/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ peer-review:
<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.">
</div>
<div class="archive__item-body">
<h2 class="archive__item-title">Peer Review Mentorship Program</h2>
<h2 class="archive__item-title">Peer review mentorship program</h2>
<div class="archive__item-excerpt">
<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.
</p>
Expand All @@ -81,11 +81,14 @@ peer-review:

<br clear="both">

<!-- pull blog posts not events -->
{% assign blog_posts = site.posts | where_exp: "item", "item.categories contains 'blog-post'" %}

<div class="notice-highlight" markdown="1">
## Recent Blog Posts & Updates
## Recent blog posts & updates

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

<div class="cards">
<h3 ><a href="{{ site.baseurl }}{{ post.url}}" rel="permalink">{{ post.title }}</a></h3>
Expand Down

0 comments on commit df4b73f

Please sign in to comment.