chore: misc cleanup
This commit is contained in:
parent
ff00020b70
commit
c8f99441aa
13 changed files with 178 additions and 271 deletions
|
@ -23,7 +23,6 @@ const currentUrl = Astro.url.pathname;
|
|||
pageTitle={page.title}
|
||||
description={page.description}
|
||||
ogImage={page.open_graph_image}
|
||||
updated={page.updated}
|
||||
currentUrl={currentUrl}
|
||||
>
|
||||
{page.blocks.map((block) => <BlockRenderer block={block} />)}
|
||||
|
|
|
@ -8,14 +8,19 @@ import {
|
|||
} from "@tabler/icons-react";
|
||||
import { fetchBlogroll } from "@utils/data/blogroll.js";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
const blogroll = await fetchBlogroll();
|
||||
const currentUrl = Astro.url.pathname;
|
||||
const title = "Blogroll";
|
||||
const description =
|
||||
"These are awesome blogs that I enjoy and you may enjoy too.";
|
||||
---
|
||||
|
||||
<Layout pageTitle={title} description={description} currentUrl={currentUrl}>
|
||||
<Layout
|
||||
pageTitle={title}
|
||||
description={description}
|
||||
currentUrl={Astro.url.pathname}
|
||||
>
|
||||
<h2 class="page-title">{title}</h2>
|
||||
<p>
|
||||
You can <a
|
||||
|
|
|
@ -13,12 +13,18 @@ const book = await fetchBookByUrl(Astro.url.pathname);
|
|||
if (!book) return Astro.redirect("/404", 404);
|
||||
|
||||
const alt = `${book.title}${book.author ? ` by ${book.author}` : ""}`;
|
||||
const pageTitle = `Books / ${book.title}`;
|
||||
const description = book.description || `Details about the book ${book.title}`;
|
||||
const pageTitle = `${book.title} by ${book.author} / Books`;
|
||||
const description =
|
||||
book.description || `Details about ${book.title} by ${book.author}.`;
|
||||
const { globals } = await fetchGlobalData(Astro);
|
||||
---
|
||||
|
||||
<Layout pageTitle={pageTitle} description={description} schema="book">
|
||||
<Layout
|
||||
pageTitle={pageTitle}
|
||||
description={description}
|
||||
fullUrl={Astro.url.pathname}
|
||||
ogImage={book.image}
|
||||
>
|
||||
<a class="back-link" href="/books" title="Go back to the books index page">
|
||||
<IconArrowLeft size={18} /> Back to books
|
||||
</a>
|
||||
|
|
|
@ -6,12 +6,13 @@ import { fetchBooks } from "@utils/data/books.js";
|
|||
import { fetchGlobalData } from "@utils/data/global/index.js";
|
||||
import { md, htmlTruncate } from "@utils/helpers/general.js";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
const books = await fetchBooks();
|
||||
const { globals } = await fetchGlobalData(Astro);
|
||||
const title = "Currently reading";
|
||||
const description = "Here's what I'm reading at the moment.";
|
||||
const updated = new Date().toISOString();
|
||||
const schema = "books";
|
||||
const currentYear = new Date().getFullYear();
|
||||
const bookData = books.all
|
||||
.filter((book) => book.status === "started")
|
||||
|
@ -32,9 +33,8 @@ const bookYearLinks = (years) =>
|
|||
<Layout
|
||||
pageTitle={title}
|
||||
description={description}
|
||||
updated={updated}
|
||||
currentUrl={Astro.url.pathname}
|
||||
schema={schema}
|
||||
ogImage={bookData[0].image}
|
||||
>
|
||||
<h2 class="page-title">{title}</h2>
|
||||
<p>
|
||||
|
|
|
@ -11,6 +11,8 @@ import { fetchGlobalData } from "@utils/data/global/index.js";
|
|||
import { fetchBooks } from "@utils/data/books.js";
|
||||
import { DateTime } from "luxon";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
const { globals } = await fetchGlobalData(Astro);
|
||||
const books = await fetchBooks();
|
||||
const { year } = Astro.params;
|
||||
|
@ -42,7 +44,8 @@ const intro = isCurrentYear
|
|||
<Layout
|
||||
pageTitle={pageTitle}
|
||||
description={description}
|
||||
schema="books-year"
|
||||
fullUrl={Astro.url.pathname}
|
||||
ogImage={bookData[0].image}
|
||||
>
|
||||
<a href="/books" class="back-link">
|
||||
<IconArrowLeft size={18} /> Back to books
|
||||
|
|
|
@ -5,23 +5,12 @@ import RecentActivity from "@components/home/RecentActivity.astro";
|
|||
import RecentPosts from "@components/home/RecentPosts.astro";
|
||||
import { fetchGlobalData } from "@utils/data/global/index.js";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
const { globals } = await fetchGlobalData(Astro);
|
||||
const schema = "blog";
|
||||
const pageTitle = globals.site_name;
|
||||
const description = "This is a blog post description";
|
||||
const ogImage = globals.cdn_url + globals.avatar;
|
||||
const fullUrl = globals.url + "/blog/my-post";
|
||||
const themeColor = globals.theme_color;
|
||||
---
|
||||
|
||||
<Layout
|
||||
pageTitle={pageTitle}
|
||||
description={description}
|
||||
ogImage={ogImage}
|
||||
fullUrl={fullUrl}
|
||||
themeColor={themeColor}
|
||||
schema={schema}
|
||||
>
|
||||
<Layout>
|
||||
<Intro intro={globals.intro} />
|
||||
<RecentActivity />
|
||||
<RecentPosts />
|
||||
|
|
|
@ -5,6 +5,8 @@ import RssBanner from "@components/blocks/banners/Rss.astro";
|
|||
import { fetchLinks } from "@utils/data/links.js";
|
||||
import { fetchGlobalData } from "@utils/data/global/index.js";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
const { globals } = await fetchGlobalData(Astro);
|
||||
const links = await fetchLinks();
|
||||
const title = "Links";
|
||||
|
|
|
@ -2,7 +2,13 @@
|
|||
import Layout from "@layouts/Layout.astro";
|
||||
import ToggleContent from "@components/utils/ToggleContent.astro";
|
||||
import AssociatedMedia from "@components/blocks/AssociatedMedia.astro";
|
||||
import { IconArrowLeft, IconHeart, IconNeedle, IconMapPin, IconDeviceSpeaker } from "@tabler/icons-react";
|
||||
import {
|
||||
IconArrowLeft,
|
||||
IconHeart,
|
||||
IconNeedle,
|
||||
IconMapPin,
|
||||
IconDeviceSpeaker,
|
||||
} from "@tabler/icons-react";
|
||||
import { fetchGlobalData } from "@utils/data/global/index.js";
|
||||
import { fetchArtistByUrl } from "@utils/data/dynamic/artistByUrl.js";
|
||||
|
||||
|
@ -17,7 +23,12 @@ const alt = `${artist.name} / ${artist.country}`;
|
|||
const playLabel = artist.total_plays === 1 ? "play" : "plays";
|
||||
---
|
||||
|
||||
<Layout pageTitle={pageTitle} description={description} schema="artist">
|
||||
<Layout
|
||||
pageTitle={pageTitle}
|
||||
description={description}
|
||||
fullUrl={Astro.url.pathname}
|
||||
{artist.image}
|
||||
>
|
||||
<a href="/music" class="back-link">
|
||||
<IconArrowLeft size={18} /> Back to music
|
||||
</a>
|
||||
|
@ -42,25 +53,37 @@ const playLabel = artist.total_plays === 1 ? "play" : "plays";
|
|||
<div class="media-meta">
|
||||
<span class="title"><strong>{artist.name}</strong></span>
|
||||
<span class="sub-meta country">
|
||||
<IconMapPin size={18} /> {artist.country}
|
||||
<IconMapPin size={18} />
|
||||
{artist.country}
|
||||
</span>
|
||||
{artist.favorite && (
|
||||
<span class="sub-meta favorite">
|
||||
<IconHeart size={18} /> This is one of my favorite artists!
|
||||
</span>
|
||||
)}
|
||||
{artist.tattoo && (
|
||||
<span class="sub-meta tattoo">
|
||||
<IconNeedle size={18} /> I have a tattoo inspired by this artist!
|
||||
</span>
|
||||
)}
|
||||
{artist.total_plays > 0 && (
|
||||
<span class="sub-meta">
|
||||
<strong class="highlight-text">{artist.total_plays} {playLabel}</strong>
|
||||
</span>
|
||||
)}
|
||||
{
|
||||
artist.favorite && (
|
||||
<span class="sub-meta favorite">
|
||||
<IconHeart size={18} /> This is one of my favorite artists!
|
||||
</span>
|
||||
)
|
||||
}
|
||||
{
|
||||
artist.tattoo && (
|
||||
<span class="sub-meta tattoo">
|
||||
<IconNeedle size={18} /> I have a tattoo inspired by this artist!
|
||||
</span>
|
||||
)
|
||||
}
|
||||
{
|
||||
artist.total_plays > 0 && (
|
||||
<span class="sub-meta">
|
||||
<strong class="highlight-text">
|
||||
{artist.total_plays} {playLabel}
|
||||
</strong>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
<span class="sub-meta">
|
||||
<a href={artist.genre.url} title={`Learn more about ${artist.genre.name}`}>
|
||||
<a
|
||||
href={artist.genre.url}
|
||||
title={`Learn more about ${artist.genre.name}`}
|
||||
>
|
||||
{artist.genre.name}
|
||||
</a>
|
||||
</span>
|
||||
|
@ -76,58 +99,69 @@ const playLabel = artist.total_plays === 1 ? "play" : "plays";
|
|||
shows={artist.shows}
|
||||
/>
|
||||
|
||||
{artist.description && (
|
||||
<>
|
||||
<h2>Overview</h2>
|
||||
<ToggleContent content={artist.description} />
|
||||
</>
|
||||
)}
|
||||
{
|
||||
artist.description && (
|
||||
<>
|
||||
<h2>Overview</h2>
|
||||
<ToggleContent content={artist.description} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
{artist.concerts && (
|
||||
<>
|
||||
<p id="concerts" class="concerts">
|
||||
<IconDeviceSpeaker size={18} /> I've seen this artist live!
|
||||
</p>
|
||||
<ul>
|
||||
{artist.concerts.map((concert) => {
|
||||
const venue = concert.venue_latitude && concert.venue_longitude
|
||||
? `<a href="https://www.openstreetmap.org/?mlat=${concert.venue_latitude}&mlon=${concert.venue_longitude}#map=18/${concert.venue_latitude}/${concert.venue_longitude}">${concert.venue_name_short}</a>`
|
||||
: concert.venue_name_short;
|
||||
{
|
||||
artist.concerts && (
|
||||
<>
|
||||
<p id="concerts" class="concerts">
|
||||
<IconDeviceSpeaker size={18} /> I've seen this artist live!
|
||||
</p>
|
||||
<ul>
|
||||
{artist.concerts.map((concert) => {
|
||||
const venue =
|
||||
concert.venue_latitude && concert.venue_longitude
|
||||
? `<a href="https://www.openstreetmap.org/?mlat=${concert.venue_latitude}&mlon=${concert.venue_longitude}#map=18/${concert.venue_latitude}/${concert.venue_longitude}">${concert.venue_name_short}</a>`
|
||||
: concert.venue_name_short;
|
||||
|
||||
return (
|
||||
<li>
|
||||
On <strong class="highlight-text">{concert.date.toLocaleString(DateTime.DATE_MED)}</strong>
|
||||
{venue && <> at {venue}</>}
|
||||
{concert.notes && (
|
||||
<span> — {concert.notes}</span>
|
||||
)}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</>
|
||||
)}
|
||||
return (
|
||||
<li>
|
||||
On{" "}
|
||||
<strong class="highlight-text">
|
||||
{concert.date.toLocaleString(DateTime.DATE_MED)}
|
||||
</strong>
|
||||
{venue && <> at {venue}</>}
|
||||
{concert.notes && <span> — {concert.notes}</span>}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
{artist.albums && (
|
||||
<>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Album</th>
|
||||
<th>Plays</th>
|
||||
<th>Year</th>
|
||||
</tr>
|
||||
{artist.albums.map((album) => (
|
||||
{
|
||||
artist.albums && (
|
||||
<>
|
||||
<table>
|
||||
<tr>
|
||||
<td>{album.name}</td>
|
||||
<td>{album.total_plays}</td>
|
||||
<td>{album.release_year}</td>
|
||||
<th>Album</th>
|
||||
<th>Plays</th>
|
||||
<th>Year</th>
|
||||
</tr>
|
||||
))}
|
||||
</table>
|
||||
<p>
|
||||
<em>These are the albums by this artist that are in my collection, not necessarily a comprehensive discography.</em>
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
{artist.albums.map((album) => (
|
||||
<tr>
|
||||
<td>{album.name}</td>
|
||||
<td>{album.total_plays}</td>
|
||||
<td>{album.release_year}</td>
|
||||
</tr>
|
||||
))}
|
||||
</table>
|
||||
<p>
|
||||
<em>
|
||||
These are the albums by this artist that are in my collection, not
|
||||
necessarily a comprehensive discography.
|
||||
</em>
|
||||
</p>
|
||||
</>
|
||||
)
|
||||
}
|
||||
</article>
|
||||
</Layout>
|
||||
|
|
|
@ -8,6 +8,8 @@ import Paginator from "@components/nav/Paginator.astro";
|
|||
import { md } from "@utils/helpers/general.js";
|
||||
import { DateTime } from "luxon";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
const posts = await fetchAllPosts();
|
||||
const { page } = Astro.props;
|
||||
const { globals } = await fetchGlobalData(Astro);
|
||||
|
|
|
@ -49,7 +49,6 @@ const htmlContent = md(post.content);
|
|||
pageTitle={post.title}
|
||||
description={post.description}
|
||||
ogImage={post.open_graph_image}
|
||||
updated={post.updated}
|
||||
currentUrl={currentUrl}
|
||||
>
|
||||
<article class="standalone">
|
||||
|
|
Reference in a new issue