ICS variables

This commit is contained in:
JP Hastings-Spital 2023-12-28 21:57:52 +00:00
parent 3ca278ace3
commit ec14a3e573

View file

@ -3,10 +3,10 @@ CALSCALE:GREGORIAN
VERSION:2.0
PRODID:-//www.byjp.me
X-WR-CALNAME:{{ .Title }} byJP
X-WR-CALDESC:{{ .Summary | replaceRE "(.{61})(.*)" "$1\r\n $2" | replaceRE "( [^\r\n]{72})([^\r\n]*)" "$1\r\n $2" }}
{{- range .Data.Pages}}
X-WR-CALDESC:{{ .Summary | replaceRE "(.{61})(.*)" "$1\r\n $2" | replaceRE "( [^\r\n]{72})([^\r\n]*)" "$1\r\n $2" }}
{{- range $page := .Data.Pages}}
BEGIN:VEVENT
UID:byjp{{replace .Page.RelPermalink "/" "-"}}
UID:byjp{{ replace $page.Page.RelPermalink "/" "-" | replaceRE "(.{61})(.*)" "$1\r\n $2" | replaceRE "( [^\r\n]{72})([^\r\n]*)" "$1\r\n $2" }}
DTSTAMP:{{ .Page.Date.UTC.Format "20060102T150405Z" }}
{{ with (index .Params.timings 0) -}}
DTSTART:{{ (time.AsTime .starts).UTC.Format "20060102T150405Z" }}
@ -17,19 +17,19 @@ DURATION:{{ .duration }}
{{ range $attendees -}}
{{- if eq . "jp" }}{{ $jpDone = true }}{{ end -}}
{{- with (index site.Data.friends .) }}
ATTENDEE;CUTYPE=INDIVIDUAL;CN={{ .name }} ({{site.Title}});
ATTENDEE;CUTYPE=INDIVIDUAL;CN={{ .name }} ({{ site.Title }});
PARTSTAT=ACCEPTED:MAILTO:{{ .site }}
{{- end }}{{ end -}}
{{- if not $jpDone }}
ATTENDEE;CUTYPE=INDIVIDUAL;CN={{ site.Data.friends.jp.name }} ({{site.Title}});
ATTENDEE;CUTYPE=INDIVIDUAL;CN={{ site.Data.friends.jp.name }} ({{ site.Title }});
PARTSTAT=NEEDS-ACTION:MAILTO:{{ site.Data.friends.jp.site }}
{{- end }}
{{ end -}}
LOCATION:{{.Page.Params.location.name}}
GEO:{{.Page.Params.location.latitude}};{{.Page.Params.location.longitude}}
SUMMARY:{{.Page.Title}}
DESCRIPTION:{{ .Page.Summary | replaceRE "(.{62})(.*)" "$1\r\n $2" | replaceRE "( [^\r\n]{72})([^\r\n]*)" "$1\r\n $2" }}
URL:{{.Page.Params.link | replaceRE "(.{70})(.*)" "$1\r\n $2" | replaceRE "( [^\r\n]{72})([^\r\n]*)" "$1\r\n $2" }}
LOCATION:{{ $page.Page.Params.location.name }}
GEO:{{ $page.Page.Params.location.latitude }};{{ $page.Page.Params.location.longitude }}
SUMMARY:{{ $page.Page.Title }}
DESCRIPTION:{{ $page.Page.Summary | replaceRE "(.{62})(.*)" "$1\r\n $2" | replaceRE "( [^\r\n]{72})([^\r\n]*)" "$1\r\n $2" }}
URL:{{ $page.Page.Params.link | replaceRE "(.{70})(.*)" "$1\r\n $2" | replaceRE "( [^\r\n]{72})([^\r\n]*)" "$1\r\n $2" }}
END:VEVENT
{{- end }}
END:VCALENDAR