eicug / eicug.github.io

https://eicug.github.io
2 stars 4 forks source link

Liquid: filter conferences by current date #7

Open wdconinc opened 2 years ago

wdconinc commented 2 years ago

Right now we have

{%- if include.year=='' -%}
{%- assign selection=site.data.conferences | where: "status", include.status -%}
{%- else -%}
{%- assign selection=site.data.conferences | where: "status", include.status | where: "year", include.year -%}
{%- endif %}

which requires status to be upcoming or past and needs changes to _data to get updated. A more scalable approach may be to add a field show_until and then use a where_exp based on current date.

wdconinc commented 2 years ago

Ref: https://github.com/eicug/eicug.github.io/blob/main/_includes/conf_table.md

buddhasystem commented 2 years ago

I think the current setup gives us a little more flexibility. We can of course define a time window etc. Wouldn't this be an overkill?

wdconinc commented 2 years ago

More worried about how it looks when a conference of several months ago is still listed as 'upcoming'. Maybe we can have status: 'auto' and only then use date.

buddhasystem commented 2 years ago

Good point. I think we should do automatic expiry based on current date. There is some footwork but it's doable.

wdconinc commented 2 years ago

Proposal: add month and day fields in addition to year, and use these for 'upcoming', 'past', but also for a sort filter.