ics calendar
All checks were successful
Linting markdown on PR / unicode-check (pull_request) Successful in 1m29s

This commit is contained in:
Paolo Asperti 2024-09-29 00:06:03 +02:00
parent 14b8e84066
commit fe340ce68c
Signed by: paspo
GPG Key ID: 06D46905D19D5182
5 changed files with 79 additions and 0 deletions

View File

@ -10,7 +10,10 @@ copyright: 2024 © Bergamo Linux Users Group
paginate: 20 paginate: 20
timeout: 1800s timeout: 1800s
enableRobotsTXT: true enableRobotsTXT: true
enableGitInfo: true
params: params:
ics:
organizer: CN="BgLUG":MAILTO:info@bglug.it
description: Bergamo Linux Users Group description: Bergamo Linux Users Group
social: social:
- title: Mattermost - title: Mattermost
@ -41,6 +44,10 @@ params:
icon: fa-mail-bulk icon: fa-mail-bulk
pack: solid pack: solid
url: https://lists.linux.it/listinfo/bglug url: https://lists.linux.it/listinfo/bglug
- title: Events Caledar
icon: fa-calendar-alt
pack: solid
url: https://bglug.it/it/eventi/index.ics
- title: Facebook - title: Facebook
icon: fa-facebook-f icon: fa-facebook-f
pack: brands pack: brands
@ -209,6 +216,16 @@ languages:
defaultContentLanguage: it defaultContentLanguage: it
defaultContentLanguageInSubdir: true defaultContentLanguageInSubdir: true
outputFormats:
calendar:
baseName: index
isPlainText: true
mediaType: text/calendar
noUgly: false
permalinkable: false
root: false
protocol: webcal://
outputs: outputs:
home: home:
- html - html
@ -220,6 +237,7 @@ outputs:
- rss - rss
section: section:
- html - html
- calendar
- rss - rss
taxonomy: taxonomy:
- html - html

View File

@ -3,4 +3,11 @@ type: section
title: Events title: Events
#description: "TODO: please fill this with a description" #description: "TODO: please fill this with a description"
sidebar_right: sidebar-eventi sidebar_right: sidebar-eventi
output:
- calendar:
mediaType: text/calendar
mediaTypes:
text/calendar:
suffixes:
- ics
--- ---

View File

@ -3,4 +3,11 @@ type: section
title: Eventi title: Eventi
#description: "TODO: non so come descrivere la sezione eventi" #description: "TODO: non so come descrivere la sezione eventi"
sidebar_right: sidebar-eventi sidebar_right: sidebar-eventi
output:
- calendar:
mediaType: text/calendar
mediaTypes:
text/calendar:
suffixes:
- ics
--- ---

View File

@ -12,6 +12,10 @@ server {
rewrite ^/feed/.*$ /it/index.xml last; rewrite ^/feed/.*$ /it/index.xml last;
} }
location ~ /events/elenco/ {
try_files $uri /it/eventi/index.ics;
}
location ~ ^/wp\-content/uploads/2008/02/Statuto\.pdf$ { location ~ ^/wp\-content/uploads/2008/02/Statuto\.pdf$ {
return 301 https://bglug.it/it/chi-siamo/Statuto.pdf; return 301 https://bglug.it/it/chi-siamo/Statuto.pdf;
} }

43
layouts/events/list.ics Normal file
View File

@ -0,0 +1,43 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//BgLUG//BgLUG Events Calendar//EN
X-WR-CALNAME:BgLUG Events Calendar
X-WR-TIMEZONE:Europe/Rome
CALSCALE:GREGORIAN
METHOD:PUBLISH
{{range .Pages -}}
{{- $location := "" -}}
{{- $locations := .Params.locations -}}
{{- with (eq (printf "%T" $locations ) "string" ) -}}
{{- $location = $locations -}}
{{- end -}}
{{- with (eq (printf "%T" $locations ) "[]string" ) -}}
{{- $location = (index $locations 0) -}}
{{- end -}}
{{ if .Params.location_ics }}
{{- $location = .Params.location_ics }}
{{- end }}
BEGIN:VEVENT
SUMMARY:{{.Title}}
ORGANIZER;{{ .Site.Param "ics.organizer" }}
UID:{{ md5 .Permalink }}@bglug.it
SEQUENCE:0
STATUS:CONFIRMED
TRANSP:TRANSPARENT
LOCATION:{{ $location }}
URL:{{ .Permalink }}
{{ with .Lastmod }}DTSTAMP:{{dateFormat "20060102T150405Z" . }}
{{ end -}}
{{ if .Date }}DTSTART;TZID=Europe/Rome:{{dateFormat "20060102T150405Z" .Date }}
{{- $d := time.AsTime .Date }}
{{- $duration := .Params.duration | default "1h" }}
DTEND;TZID=Europe/Rome:{{dateFormat "20060102T150405Z" ($d.Add (time.ParseDuration $duration) ) }}
{{ end -}}
END:VEVENT
{{end -}}
END:VCALENDAR