Skip to content

Commit

Permalink
<#239> Add Contributor Calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
federicobucchi committed May 16, 2023
1 parent 9066f3e commit b5e1984
Show file tree
Hide file tree
Showing 22 changed files with 144 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ See [website overview](/website) for more information about the Swift.org websit

Swift.org uses [Jekyll](https://jekyllrb.com), a blog-aware, static site generator in Ruby.

## Calendar Updates

Update Calendar events in [calendar.yml](/_data/calendar.yml) (events are Pacific Time Zone)

### Running locally

Requirements
Expand Down
14 changes: 14 additions & 0 deletions _data/calendar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- date: 2023-3-22
entries:
- name: Test 1
description: Description 1
location: Location 1
url: https://www.swift.org
start: "08:30:00"
duration: 0H30M
- name: Test 2
description: Description 2
location: Location 2
url: https://www.swift.org
start: "18:00:00"
duration: 2H30M
2 changes: 2 additions & 0 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
name: license
- title: Forums
name: forums
- title: Calendar
url: /calendar/
- title: Diversity
url: /diversity/
sections:
Expand Down
11 changes: 11 additions & 0 deletions assets/javascripts/color-scheme-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ function getColorSchemeAttribute() {

function updateColorSchemeAttribute(color) {
document.body.setAttribute('data-color-scheme', color);
setupComponentsColorScheme();
}

function setupComponentsColorScheme() {
setTimeout(() => {
if (document.querySelector('swift-calendar')) {
document.querySelector('swift-calendar').setAttribute('theme', getColorSchemeAttribute());
}
})
}

function preferredColorSchemeSetting() {
Expand Down Expand Up @@ -179,4 +188,6 @@ function ready() {
getToggleRadioNodeList().addEventListener('change', (e) => {
setColorSchemeFor(e.target.value);
});

setupComponentsColorScheme();
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions assets/javascripts/web-components/components/files/SwiftEvents.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: none
---
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:DAYLIGHT
TZOFFSETFROM:-0800
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
TZNAME:PDT
TZOFFSETTO:-0700
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0700
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
TZNAME:PST
TZOFFSETTO:-0800
END:STANDARD
END:VTIMEZONE
PRODID:Swift Calendar
METHOD:PUBLISH
X-PUBLISHED-TTL:PT1H
{% for calendar in site.data.calendar %}
{% for entry in calendar.entries %}
BEGIN:VEVENT
UID:{{ calendar.date | date: "%Y%m%d" }}{{ entry.name }}@swift.org
SUMMARY:{{ entry.name }}
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%S" }}
DTSTART;TZID="America/Los_Angeles":{{ calendar.date | append:" " | append:entry.start | append:" " | append:"-0700" | date: "%Y%m%dT%H%M%S" }}
DESCRIPTION:{{ entry.description }}
URL:{{ entry.url }}
LOCATION:{{ entry.location }}
DURATION:PT{{ entry.duration }}
END:VEVENT
{% endfor %}
{% endfor %}
END:VCALENDAR
22 changes: 22 additions & 0 deletions assets/javascripts/web-components/components/files/feed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
layout: none
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ "Swift Calendar" | xml_escape }}</title>
<description>{{ "Swift Calendar" | xml_escape }}</description>
<link>https://www.swift.org</link>
<atom:link href="{{ site.url }}/assets/javascripts/swift-web-components/components/files/feed.xml" rel="self" type="application/rss+xml" />
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
{% for calendar in site.data.calendar %}
{% for entry in calendar.entries %}
<item>
<title>{{ entry.name | xml_escape }}</title>
<description>{{ entry.description | xml_escape }}</description>
</item>
{% endfor %}
{% endfor %}
</channel>
</rss>
2 changes: 2 additions & 0 deletions assets/javascripts/web-components/index.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/javascripts/web-components/index.esm.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions assets/javascripts/web-components/p-6c241004.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/javascripts/web-components/p-6c241004.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions assets/javascripts/web-components/p-f2db04cf.entry.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/javascripts/web-components/p-f2db04cf.entry.js.map

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b5e1984

Please sign in to comment.