ics calendar #265

Merged
paspo merged 6 commits from paspo/bglug.it:ics-calendar into main 2024-10-02 13:22:49 +00:00
Showing only changes of commit 5d608c7aa6 - Show all commits

View File

@ -52,20 +52,25 @@ UID:{{ md5 .Permalink }}@bglug.it
SEQUENCE:0 SEQUENCE:0
STATUS:CONFIRMED STATUS:CONFIRMED
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
{{- if ne $description "" }} {{- if ne $description "" }}
{{- $description = replace $description "\n" " " }} {{- $description = replace $description "\n" " " }}
{{- $description = (print "DESCRIPTION:" $description ) | truncate 400 }} {{- $description = (print "DESCRIPTION:" $description ) | truncate 400 }}
{{- $l := $description | len }}
{{- $i := 0 }} {{- $i := 0 }}
{{- range seq 0 $numcaratteri $l }} {{- range seq 0 $numcaratteri ($description | len) }}
{{ strings.Repeat $i " " }}{{- substr $description . $numcaratteri }} {{ strings.Repeat $i " " }}{{- substr $description . $numcaratteri }}
{{- $i = add $i 1 }} {{- $i = add $i 1 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
LOCATION:{{ $location }} LOCATION:{{ $location }}
URL:{{ .Permalink }} URL:{{ .Permalink }}
{{- with (.Page.Resources.GetMatch .Params.image ) -}}
{{- $image := print "IMAGE;VALUE=URI;DISPLAY=BADGE;FMTTYPE=" .MediaType.String ":" .Permalink }}
{{- $i := 0 }}
{{- range seq 0 $numcaratteri ($image | len) }}
{{ strings.Repeat $i " " }}{{- substr $image . $numcaratteri }}
{{- $i = add $i 1 }}
{{- end }}
{{ end -}}
{{ with .Lastmod }}DTSTAMP:{{dateFormat "20060102T150405Z" . }} {{ with .Lastmod }}DTSTAMP:{{dateFormat "20060102T150405Z" . }}
{{ end -}} {{ end -}}
{{ if .Date }}DTSTART;TZID=Europe/Rome:{{dateFormat "20060102T150405" .Date }} {{ if .Date }}DTSTART;TZID=Europe/Rome:{{dateFormat "20060102T150405" .Date }}