feat: cloudflare -> netlify

This commit is contained in:
Cory Dransfeldt 2024-11-29 15:12:47 -08:00
parent a7e0b36d82
commit a74ea3644d
No known key found for this signature in database
41 changed files with 2021 additions and 2395 deletions

View file

@ -1,14 +1,26 @@
---
import { CacheHeaders, ONE_HOUR } from 'cdn-cache-control';
import Layout from "@layouts/Layout.astro";
import AssociatedMedia from "@components/blocks/AssociatedMedia.astro";
import icons from "@cdransf/astro-tabler-icons";
import { fetchGlobalData } from "@utils/data/global/index.js";
import { mediaLinks } from "@utils/helpers/media.js";
import { md } from "@utils/helpers/general.js";
import slugify from "slugify";
const { genre } = await fetchGlobalData(Astro, Astro.url.pathname);
if (!genre) return Astro.redirect("/404", 404);
const headers = new CacheHeaders()
.swr()
.ttl(ONE_HOUR)
.tag(['genre', `genre-${slugify(genre.name, { lower: true })}`]);
headers.forEach((value, key) => {
Astro.response.headers.set(key, value);
});
const { IconArrowLeft } = icons;
const artistCount = genre.artists?.length || 0;
const connectingWords = artistCount > 1 ? "artists are" : "artist is";