fix: ogurls + naming for prop; recent listens timestamp

This commit is contained in:
Cory Dransfeldt 2024-11-23 19:16:12 -08:00
parent d679bbb7e1
commit 4c5ee38f9c
No known key found for this signature in database
18 changed files with 20 additions and 20 deletions

View file

@ -33,7 +33,7 @@ const { globals } = await fetchGlobalData(Astro);
</div>
</div>
<time datetime={item.chart.played_at}>
{new Date(item.chart.played_at).toLocaleString("en-US", {
{new Date(item.chart.played_at * 1000).toLocaleString("en-US", {
timeZone: "America/Los_Angeles",
month: "long",
day: "numeric",

View file

@ -13,7 +13,7 @@ const {
pageTitle = globals.site_name,
description = globals.site_description,
ogImage = globals.avatar,
fullUrl = currentUrl,
pageUrl = currentUrl,
} = Astro.props;
const pageDescription = md(description);
@ -46,7 +46,7 @@ const pageDescription = md(description);
type="font/woff2"
crossorigin="anonymous"
/>
<link rel="canonical" href={`${globals.url}${fullUrl}`} />
<link rel="canonical" href={`${globals.url}${pageUrl}`} />
<meta
property="og:title"
content={pageTitle !== globals.site_name
@ -62,7 +62,7 @@ const pageDescription = md(description);
content={htmlToText(htmlTruncate(pageDescription))}
/>
<meta property="og:type" content={schema || "page"} />
<meta property="og:url" content={fullUrl} />
<meta property="og:url" content={`${globals.url}${pageUrl}`} />
<meta
property="og:image"
content={`${globals.cdn_url}${ogImage}?class=w800`}

View file

@ -21,7 +21,7 @@ const description =
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={book.image}
>
<a class="back-link" href="/books" title="Go back to the books index page">

View file

@ -50,7 +50,7 @@ const intro = isCurrentYear
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={bookData[0]?.image || ""}
>
<a href="/books" class="back-link">

View file

@ -29,7 +29,7 @@ const playLabel = artist.total_plays === 1 ? "play" : "plays";
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
{artist.image}
>
<a href="/music" class="back-link">

View file

@ -20,7 +20,7 @@ const description = `Discover the music genre ${genre.name}, featuring ${artistC
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={genre.artists[0].image}
>
<a class="back-link" href="/music" title="Go back to the music index page">

View file

@ -44,7 +44,7 @@ const description =
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={shuffleArray(page.data)[0]?.album_art}
>
<a href="/music" class="back-link">

View file

@ -44,7 +44,7 @@ const description = "These are the artists I've been listening to this month. Al
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={shuffleArray(page.data)[0]?.artist_art}
>
<a href="/music" class="back-link">

View file

@ -26,7 +26,7 @@ const topGenres = mediaLinks(music.month.genres, "genre", 5);
<Layout
pageTitle={title}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={music.month.artists[0].image}
>
<h2 class="page-title">{title}</h2>

View file

@ -44,7 +44,7 @@ const description =
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={shuffleArray(page.data)[0]?.album_art}
>
<a href="/music" class="back-link">

View file

@ -44,7 +44,7 @@ const description = "These are the artists I've been listening to this week. All
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={shuffleArray(page.data)[0]?.artist_art}
>
<a href="/music" class="back-link">

View file

@ -37,7 +37,7 @@ const description = "These are my favorite movies. There are many like them, but
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={shuffleArray(page.data)[0].backdrop}
>
<a href="/watching" class="back-link">

View file

@ -37,7 +37,7 @@ const description = "These are my favorite TV shows. There are many like them, b
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={shuffleArray(page.data)[0].backdrop}
>
<a href="/watching" class="back-link">

View file

@ -25,7 +25,7 @@ const description =
<Layout
pageTitle={title}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={movies.recentlyWatched[0].backdrop}
>
<h2 class="page-title">{title}</h2>

View file

@ -25,7 +25,7 @@ const alt = `${movie.title} / ${movie.year}${movie.rating ? ` (${movie.rating})`
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={movie.backdrop}
>
<a class="back-link" href="/watching" title="Go back to the watching index page">

View file

@ -41,7 +41,7 @@ const description =
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={shuffleArray(page.data)[0].backdrop}
>
<a href="/watching" class="back-link">

View file

@ -42,7 +42,7 @@ const description = "All of the shows I've watched recently.";
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={shuffleArray(page.data)[0].backdrop}
>
<a href="/watching" class="back-link">

View file

@ -25,7 +25,7 @@ const alt = `${show.title} / ${show.year}`;
<Layout
pageTitle={pageTitle}
description={description}
fullUrl={Astro.url.pathname}
pageUrl={Astro.url.pathname}
ogImage={show.backdrop}
>
<a class="back-link" href="/watching" title="Go back to the watching index page">