Skip to content

Commit 71dcfde

Browse files
author
Zyna
committed
feat: add titleOverride
1 parent db9f1d1 commit 71dcfde

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

content/post/_content.gotmpl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
{{ $template := .attributes.template.data.attributes }}
2020
{{ $image := $template.image.data.attributes }}
2121

22+
{{/* Use {$template.title} or {.titleOverride} */}}
23+
{{ $title := $template.title }}
24+
{{ if .attributes.titleOverride }}
25+
{{ $title = .attributes.titleOverride }}
26+
{{ end }}
27+
2228
{{/* Use {timeDescription} | {presenceMode} @ {venueName} for subtitle. */}}
2329
{{ $presenceMode := .attributes.presenceMode }}
2430
{{ $timeDescription := .attributes.timeDescription }}
@@ -31,7 +37,7 @@
3137
{{ $subtitle = printf "%s | %s" $timeDescription $presenceMode }}
3238
{{ end }}
3339

34-
{{/* Use /{title}-{id} path for post. */}}
40+
{{/* Use /{$template.title}-{id} path for post. */}}
3541
{{ $path := (printf "%s-%.0f" $template.title .id) }}
3642

3743
{{/* Extract tags. */}}
@@ -57,7 +63,7 @@
5763
"kind" "page"
5864
"params" $params
5965
"path" $path
60-
"title" $template.title
66+
"title" $title
6167
}}
6268

6369
{{ $.AddPage $page }}

0 commit comments

Comments
 (0)