Skip to content

Commit ce7797a

Browse files
feat: add ldjson for events
1 parent 003e492 commit ce7797a

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

layouts/partials/head.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,22 @@
6969
});
7070
</script>
7171
{{ end }}
72-
72+
{{ "<!-- ENTERING LDJSON for events -->" | safeHTML }}
73+
{{ if .IsPage }}
74+
{{ if eq .Type "events" }}
75+
<script type="application/ld+json">
76+
{
77+
"@context": "https://schema.org",
78+
"@type": "Event",
79+
"name": "{{ .Params.Title }}",
80+
"startDate": "{{ .Params.date.Format "2006-01-02T15:04:05JST" }}",
81+
"url": "{{ .Params.youtubeLink }}",
82+
"image": "{{ .Params.image | absURL }}",
83+
}
84+
</script>
85+
{{ end }}
86+
{{ end }}
87+
{{ "<!-- LEAVING LDJSON for events -->" | safeHTML }}
7388
{{ "<!-- Mastodon verification code -->" | safeHTML }}
7489
<link href="https://fosstodon.org/@innersource" rel="me">
7590

0 commit comments

Comments
 (0)