-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathlist.html
More file actions
105 lines (91 loc) · 4.05 KB
/
list.html
File metadata and controls
105 lines (91 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{{ define "main" }}
{{ $pageLink := .Permalink }}
<section class="content-padding flex-row">
<div class="content-container">
<div class="columns">
<div class="column is-centered-tablet-portrait">
<h1 class="title section-title">{{ .Title }}</h1>
<h5 class="subtitle">{{ .Params.Subtitle }}</h5>
<div class="divider"></div>
</div>
</div>
{{ .Content }}
<div class="calendar-list">
{{ range $key, $value := $.Site.Data.calendars }}
<div class="calendar"><a href="{{ $key }}.ics">{{ .name }}</a>
<img
class="calendar-copy"
src="/images/content_copy.svg"
onclick="navigator.clipboard.writeText('{{ printf "%s%s.ics" $pageLink $key }}');"
/>
{{ range .events }}
<div class="calendar-event">{{ .summary }}</div>
{{ end }}
</div>
{{ end }}
</div>
<br>
<script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
<script src="https://unpkg.com/ical.js/dist/ical.es5.min.cjs"></script>
<script src='https://cdn.jsdelivr.net/npm/fullcalendar@6.1.18/index.global.min.js'></script>
<!-- This is a temporary workaround for https://github.com/fullcalendar/fullcalendar/issues/7456
PR proposed in https://github.com/fullcalendar/fullcalendar/pull/7450 was compiled and is sourced
below as `icalendar.js`
Build procedure:
0. Clone git@github.com:fullcalendar/fullcalendar.git
1. pnpm install
2. pnpm run build
3. Unzip resulting archive in ./dist
4. Copy /dist/fullcalendar-6.1.19/packages/icalendar/index.global.js to static/js-non-bundled/icalendar.js -->
<!-- <script src="https://cdn.jsdelivr.net/npm/@fullcalendar/icalendar@6.1.19/index.global.min.js"></script> -->
<script src="/js-non-bundled/icalendar.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var cal_colors = vega.scheme('category10');
var community_calendar = document.getElementById('community-calendar');
var calendar = new FullCalendar.Calendar(community_calendar, {
aspectRatio: 1,
timeZone: 'local',
initialView: 'timeGridWeek',
headerToolbar: {
left: "prev,next today",
center: "title",
right: "dayGridMonth,timeGridWeek,listWeek",
},
eventSources: [
{{- range $key, $value:= $.Site.Data.calendars }}
{
url: '{{ $key }}.ics',
format: 'ics',
backgroundColor: cal_colors.shift(),
},
{{- end }}
],
eventClick: function(info) {
info.jsEvent.preventDefault();
alert('Event: ' + info.event.title + '\n' + info.event.extendedProps.description + '\n' + 'URL: ' +info.event.url);
},
eventDisplay: 'block',
});
calendar.render();
});
</script>
<div id='community-calendar'></div>
<h3 id="subscribe-google-calendar">Google Calendar</h3>
Instructions from <a href="https://support.google.com/calendar/answer/37100?hl=en&co=GENIE.Platform%3DDesktop">the Google Calendar docs</a>:
<ol>
<li>Open Google Calendar</li>
<li>On the left, next to "Other calendars," click Add Add other calendars and then From URL.</li>
<li>Enter the calendar's address.</li>
<li>Click Add calendar. The calendar appears on the left, under "Other calendars."</li>
</ol>
It may take up to 12 hours for calendar changes to propagate.
</div>
</div>
<div id="shortcuts-container">
<div id="shortcuts">
<div id="shortcuts-header"><i class="fa-solid fa-list"></i> On this page</div>
</div>
</div>
</section>
{{ end }}