Skip to content

Commit b490da8

Browse files
feat: set expiry date one day after start date
1 parent b340621 commit b490da8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

content/post/_content.gotmpl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@
5353
{{ $contentValue := partial "post_content" . }}
5454
{{ $content := dict "mediaType" "text/markdown" "value" $contentValue }}
5555

56-
{{/* Set "Posted on" date. */}}
57-
{{ $dates := dict "date" (time.AsTime .attributes.publishedAt) }}
58-
5956
{{/* Get sorting weight based on start date */}}
6057
{{ $startAt := time.AsTime .attributes.startAt }}
6158
{{ $weight := mul -1 $startAt.Unix }}
6259

60+
{{/* Set expiryDate one day later */}}
61+
{{ $expiryDate := $startAt.AddDate 0 0 1 }}
62+
63+
{{/* Set "Posted on" and expiry date. */}}
64+
{{ $dates := dict "date" (time.AsTime .attributes.publishedAt) "expiryDate" $expiryDate }}
65+
6366
{{/* Add page. */}}
6467
{{ $page := dict
6568
"content" $content

0 commit comments

Comments
 (0)