Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an ical (.ics) feed that includes all our events #58

Merged
merged 6 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Custom static site content
_site/*
!_site/geogeeks.ics

# Jekyll
.sass-cache/
Expand Down
5 changes: 4 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
website: https://geogeeks.org
keep_files: [ workshops, geogeeks.ics ]
domain: geogeeks.org
title: Geogeeks Perth
email: [email protected]
keep_files: [ workshops ]
plugins:
- jekyll-leaflet
timezone: Australia/Perth
40 changes: 26 additions & 14 deletions _layouts/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,29 @@

<p>This page lists all {{events_data.size}} events that we have documented on this website so far.</p>

<ul>
{% assign prev_year = false %}
{% for event in events_data %}
{% assign year = event.path|slice: 0,4 %}
{% if year != prev_year %}
</ul>
<h3>{{year}}</h3>
<ul>
{% endif %}
{% assign prev_year = year %}
<!-- {{event|inspect}} -->
<li>{{ event.start_time|date: "%B %e" }}: <a href="{{ event.url }}">{{ event.title }}</a></dd>
{% endfor %}
</ul>
<div>
{% assign prev_year = false %}
{% for event in events_data %}
{% assign year = event.path|slice: 0,4 %}
{% if year != prev_year %}
</div>

<h3>{{year}}</h3>
<div class="list-group mb-3">
{% endif %}
{% assign prev_year = year %}

<!-- {{event|inspect}} -->
<a href="{{ event.url }}" class="list-group-item list-group-item-action">
<div class="d-flex w-100 justify-content-between">
<h5>{{ event.title }}</h5>
<span>{{ event.location.name}}, <b>{{ event.start_time|date: "%B %e" }}</b></span>
</div>
<span class="one-line-summary text-muted">{{ event.content | split: "

" | first | markdownify | strip_html }}</span>

</a>

{% endfor %}
</div>
29 changes: 29 additions & 0 deletions _layouts/ical.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
---
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//{{ site.domain }}//{{ site.title }}//EN
CALSCALE:GREGORIAN{% assign events_data = site.pages | where: "layout", "event" | sort: "path" | reverse %}{% for event in events_data %}
BEGIN:VEVENT
URL:{{ event.url | prepend: site.url }}
UID:{{ event.url | prepend: site.domain }}
{%- comment -%}
DTSTAMP is when this file was generated,
CREATED is when the event was first created,
LAST-MODIFIED is when the content of this VEVENT changed, and
SEQUENCE is an int that increments when the event changes substantially (such that RSVPs should be reconsidered).
{% endcomment %}
DTSTAMP: {{ site.time | to_utc | date: "%Y%m%dT%H%M%SZ" }}
CLASS: PUBLIC
SUMMARY:{{ event.title }}
ORGANIZER;CN="{{ site.title }}":MAILTO:{{ site.email }}
DTSTART;TZID=/{{ site.timezone }}:{{ event.start_time | date: "%Y%m%dT%H%M%S" }}{% if event.end_time %}
DTEND;TZID=/{{ site.timezone }}:{{ event.end_time | date: "%Y%m%dT%H%M%S" }}{% else %}
DURATION:PT2H{% endif %}
LOCATION:{{ event.location.name }}{% if event.location.address %}, {{ event.location.address }}{% endif %}{% if event.location.latitude and event.location.longitude %}
GEO:{{ event.location.latitude }};{{ event.location.longitude }}{% endif %}
DESCRIPTION:{{ event.content | strip_html | replace: "
", "\n" | strip }}
X-ALT-DESC;FMTTYPE=text/html:{{ event.content | strip_newlines | normalise_whitespace | strip}}
END:VEVENT{% endfor %}
END:VCALENDAR
9 changes: 9 additions & 0 deletions _plugins/utc_filter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Jekyll
module UTCFilter
def to_utc(date)
time(date).utc
end
end
end

Liquid::Template.register_filter(Jekyll::UTCFilter)
62 changes: 0 additions & 62 deletions _site/geogeeks.ics

This file was deleted.

12 changes: 12 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ header.masthead p {
width:100%;
}

.list-group {
line-height: normal;
}

.text-white a {
color: white;
text-decoration: underline;
Expand All @@ -59,6 +63,14 @@ header.masthead p {
color: #b83a17;
}

.one-line-summary {
display: inline-block;
max-width: 100%;
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
}

.bigmap .leaflet-map {
/* @todo There's probably a better way to do this. */
height: 80vh !important;
Expand Down
3 changes: 3 additions & 0 deletions geogeeks.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
layout: ical
---