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 "add to calendar" button to event pages #486

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
15 changes: 15 additions & 0 deletions _includes/calendar-button.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<add-to-calendar-button
name="{{ site.title }}"
{% comment %}startDate is required{% endcomment %}
startDate="1970-01-01"
subscribe
icsFile="https://studentrobotics.org/events.ics"
iCalFileName="{{ site.title }}"
options="'Apple','Google','iCal','Outlook.com','Microsoft 365','Microsoft Teams'"
size="4|4|2"
buttonStyle="flat"
trigger="click"
hideBackground
styleLight="--btn-shadow: none; --btn-border: none; --font: 'Open Sans', Arial, sans-serif"
lightMode="light"
/>
2 changes: 2 additions & 0 deletions _includes/script.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script src="{{ '/js/main.js' | prepend: site.baseurl }}"></script>
<script src="{{ '/js/localise-times.js' | prepend: site.baseurl }}"></script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/atcb.min.js"></script>

{% if site.user_tracking %}
<script defer data-domain="studentrobotics.org" src="https://plausible.io/js/plausible.js"></script>
{% endif %}
3 changes: 2 additions & 1 deletion _layouts/event.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: page
---
<div class="header-card">
<div class="header-card with-calendar-button">
<div class="fixed-width">
<h1>{{ page.title }}</h1>
{% include calendar-button.html %}
</div>
</div>
<div class="main">
Expand Down
8 changes: 8 additions & 0 deletions _sass/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
color: $sr-white;
margin-bottom: 0;
}

&.with-calendar-button .fixed-width {
display: flex;
justify-content: space-between;
overflow: initial;
align-items: center;

}
}

.top-spacing {
Expand Down
3 changes: 2 additions & 1 deletion events.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
title: Events
permalink: /events/
---
<div class="header-card">
<div class="header-card with-calendar-button">
<div class="fixed-width">
<h1>Events</h1>
{% include calendar-button.html %}
</div>
</div>
<div class="main">
Expand Down