Skip to content

Commit 5e1a773

Browse files
committed
Add audio metatag
1 parent 7c3eb59 commit 5e1a773

File tree

1 file changed

+9
-2
lines changed
  • src/app/(main)/(home)/[artistSlug]/[year]/[month]/[day]/[songSlug]

1 file changed

+9
-2
lines changed

src/app/(main)/(home)/[artistSlug]/[year]/[month]/[day]/[songSlug]/page.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ export const generateMetadata = async (props) => {
3131
?.map((source) => source?.sets?.map((set) => set?.tracks).flat())
3232
.flat();
3333

34-
const songTitle = songs?.find((song) => song?.slug === songSlug)?.title;
34+
const song = songs?.find((song) => song?.slug === songSlug);
3535

3636
return {
37-
title: [songTitle, createShowDate(year, month, day), name].join(' | '),
37+
title: [song?.title, createShowDate(year, month, day), name].filter((x) => x).join(' | '),
3838
description: [show?.venue?.name, show?.venue?.location].filter((x) => x).join(' '),
39+
openGraph: {
40+
audio: [
41+
{
42+
url: song?.mp3_url, // Must be an absolute URL
43+
},
44+
],
45+
},
3946
};
4047
};

0 commit comments

Comments
 (0)