+ + At {{ .Params.location.name }} +
+- On {{ partial "year-relative-date.html" (time.AsTime $timing.starts) }} + On {{ partial "year-relative-date.html" (slice (time.AsTime $timing.starts) "dt-start") }}
{{ $starts := time.AsTime $timing.starts }} - {{ $duration := time.ParseDuration ((strings.Substr $timing.duration 2) | strings.ToLower) }} - From {{ $starts.Format "15:04" }} until {{ $starts.Add $duration | dateFormat "15:04 (MST)" }} + {{ $duration := ((strings.Substr $timing.duration 2) | strings.ToLower) }} + From {{ $starts.Format "15:04" }} until {{ $starts.Add (time.ParseDuration $duration) | dateFormat "15:04 (MST)" }} ({{ $duration }})
- + {{ if .Params.attending }}@@ -74,6 +82,13 @@
{{ end }} ++ + More info on {{ (urls.Parse .Params.link).Host }} +
diff --git a/layouts/partials/geolink.html b/layouts/partials/geolink.html new file mode 100644 index 00000000..f71dd333 --- /dev/null +++ b/layouts/partials/geolink.html @@ -0,0 +1 @@ +http://www.openstreetmap.org/?mlat={{.latitude}}&mlon={{.longitude}}&zoom=18&layers=M \ No newline at end of file diff --git a/layouts/partials/year-relative-date.html b/layouts/partials/year-relative-date.html index 6970c9f5..a6e7f105 100644 --- a/layouts/partials/year-relative-date.html +++ b/layouts/partials/year-relative-date.html @@ -1 +1,4 @@ - \ No newline at end of file +{{- $date := . -}} +{{- $extraClass := slice -}} +{{ if reflect.IsSlice . -}}{{ $date = index . 0 }}{{ $extraClass = index . 1 }}{{ end -}} + \ No newline at end of file diff --git a/todo.md b/todo.md index 274c865e..77551658 100644 --- a/todo.md +++ b/todo.md @@ -1,4 +1,7 @@ Add single.html for Calendar {cm:2023-12-24} Support repeating calendar events Handle long lines {cm:2023-12-24} -Ensure ICS files have CRLF endings {cm:2023-12-22} \ No newline at end of file +Ensure ICS files have CRLF endings {cm:2023-12-22} +Add microformats {cm:2023-12-24} +Add lat & long to h-event p-location +Debug why h-event doesn't seem to be showing \ No newline at end of file