From 5d608c7aa6053cb813532aa3c27c3783857c51c3 Mon Sep 17 00:00:00 2001 From: paspo Date: Tue, 1 Oct 2024 23:12:52 +0200 Subject: [PATCH] image --- layouts/_default/home.calendar.ics | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/layouts/_default/home.calendar.ics b/layouts/_default/home.calendar.ics index 271a377..4d20c12 100644 --- a/layouts/_default/home.calendar.ics +++ b/layouts/_default/home.calendar.ics @@ -52,20 +52,25 @@ UID:{{ md5 .Permalink }}@bglug.it SEQUENCE:0 STATUS:CONFIRMED TRANSP:TRANSPARENT - {{- if ne $description "" }} {{- $description = replace $description "\n" " " }} {{- $description = (print "DESCRIPTION:" $description ) | truncate 400 }} - {{- $l := $description | len }} {{- $i := 0 }} - {{- range seq 0 $numcaratteri $l }} + {{- range seq 0 $numcaratteri ($description | len) }} {{ strings.Repeat $i " " }}{{- substr $description . $numcaratteri }} - {{- $i = add $i 1 }} + {{- $i = add $i 1 }} {{- end }} - {{- end }} LOCATION:{{ $location }} 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" . }} {{ end -}} {{ if .Date }}DTSTART;TZID=Europe/Rome:{{dateFormat "20060102T150405" .Date }}