Skip to content

Commit 70a78f0

Browse files
pulumi-botclaude[bot]claude
authored
fix(schema): stop fabricating VideoObject uploadDate from git info and now (#20904)
video-entity.html was the one schema collector still holding the pattern the rest of this PR removes: uploadDate fell back to .GitInfo.AuthorDate and then to now() whenever a page had no front-matter date, fabricating an upload date from a "last touched" timestamp (or, on a shallow CI checkout, stamping every dateless page as uploaded today). uploadDate is required for VideoObject, so unlike datePublished it can't simply be omitted. Instead the entity is skipped entirely when there's no explicit front-matter date, and the date now comes only from .PublishDate (which resolves front-matter date/publishDate) rather than .Date, whose resolution chain can reach the lastmod key. graph-builder.html already guards against an empty collector result, so a skipped entity is a no-op in the @graph. Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 0eef03f commit 70a78f0

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

layouts/partials/schema/collectors/video-entity.html

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,27 @@
2929

3030
{{/* Generate VideoObject schema for first video only (primary video) */}}
3131
{{ $schema := dict }}
32-
{{ if gt (len $videos) 0 }}
32+
33+
{{/* Get the upload date, but only from a real source of truth: an explicit
34+
front-matter date/publishDate (Hugo's .PublishDate resolves both). Never
35+
from git info, since a page's git history reflects when it was last
36+
*touched*, not when its video was uploaded, and never from `now`, which
37+
on an absent git history (e.g. a shallow CI checkout) would stamp every
38+
page as uploaded today. Unlike datePublished in the article/blog/FAQ
39+
collectors, uploadDate is required for VideoObject, so it can't simply be
40+
omitted — when there's no real date we skip emitting the entity entirely
41+
rather than publish an invalid or fabricated one. Mirrors the date policy
42+
in schema/collectors/article-entity.html. */}}
43+
{{ $publishDate := "" }}
44+
{{ if and .PublishDate (ne (.PublishDate.Format "2006-01-02") "0001-01-01") }}
45+
{{ $publishDate = .PublishDate }}
46+
{{ end }}
47+
48+
{{ if and (gt (len $videos) 0) $publishDate }}
3349
{{ $primaryVideoId := index $videos 0 }}
3450
{{ $videoTitle := .Title }}
3551
{{ $videoDescription := or .Params.meta_desc .Summary (printf "Video content for: %s" .Title) }}
3652

37-
{{/* Get publish date with fallback */}}
38-
{{ $publishDate := .Date }}
39-
{{ if or (not $publishDate) (eq ($publishDate.Format "2006-01-02") "0001-01-01") }}
40-
{{ if and .GitInfo .GitInfo.AuthorDate }}
41-
{{ $publishDate = .GitInfo.AuthorDate }}
42-
{{ else }}
43-
{{ $publishDate = now }}
44-
{{ end }}
45-
{{ end }}
46-
4753
{{/* Build video schema */}}
4854
{{ $schema = dict
4955
"@type" "VideoObject"

0 commit comments

Comments
 (0)