feat(*.liquid): apply prettier to liquid templates

- offer to create tag when none is found while adding a link from cli
- fix tag display in search
This commit is contained in:
Cory Dransfeldt 2025-06-16 14:40:54 -07:00
parent 49e21d574e
commit efe701f939
No known key found for this signature in database
112 changed files with 1319 additions and 1134 deletions

View file

@ -1,23 +1,23 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAlbumReleases = async () => {
try {
const data = await EleventyFetch(`${POSTGREST_URL}/optimized_album_releases`, {
duration: '1d',
type: 'json',
duration: "1d",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
const pacificNow = new Date().toLocaleString('en-US', {
timeZone: 'America/Los_Angeles'
const pacificNow = new Date().toLocaleString("en-US", {
timeZone: "America/Los_Angeles"
});
const pacificDate = new Date(pacificNow);
pacificDate.setHours(0, 0, 0, 0);
@ -29,11 +29,11 @@ const fetchAlbumReleases = async () => {
return {
...album,
description: album.artist?.description || 'No description',
date: releaseDate.toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
description: album.artist?.description || "No description",
date: releaseDate.toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric"
})
};
})
@ -45,7 +45,7 @@ const fetchAlbumReleases = async () => {
return { all, upcoming };
} catch (error) {
console.error('Error fetching and processing album releases:', error);
console.error("Error fetching and processing album releases:", error);
return { all: [], upcoming: [] };
}
};

View file

@ -1,16 +1,16 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
export default async function fetchAllActivity() {
try {
const data = await EleventyFetch(`${POSTGREST_URL}/optimized_all_activity`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
@ -18,7 +18,7 @@ export default async function fetchAllActivity() {
return data?.[0] || [];
} catch (error) {
console.error('Error fetching activity:', error);
console.error("Error fetching activity:", error);
return [];
}
}

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchBlogroll = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_blogroll`, {
duration: '1d',
type: 'json',
duration: "1d",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching and processing the blogroll:', error);
console.error("Error fetching and processing the blogroll:", error);
return [];
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllBooks = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_books?order=date_finished.desc`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching books:', error);
console.error("Error fetching books:", error);
return [];
}
};
@ -42,7 +42,7 @@ export default async function () {
const booksForCurrentYear =
sortedByYear
.find((yearGroup) => yearGroup.value === currentYear)
?.data.filter((book) => book.status === 'finished') || [];
?.data.filter((book) => book.status === "finished") || [];
return {
all: books,

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllConcerts = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_concerts`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching concerts:', error);
console.error("Error fetching concerts:", error);
return [];
}
};
@ -32,7 +32,7 @@ export default async function () {
const concerts = await fetchAllConcerts();
return processConcerts(concerts);
} catch (error) {
console.error('Error fetching and processing concerts data:', error);
console.error("Error fetching and processing concerts data:", error);
return [];
}
}

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchFeeds = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_feeds?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching feed metadata:', error);
console.error("Error fetching feed metadata:", error);
return [];
}
};
@ -24,12 +24,12 @@ const fetchFeeds = async () => {
const fetchFeedData = async (feedKey) => {
try {
return await EleventyFetch(`${POSTGREST_URL}/rpc/get_feed_data`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'POST',
method: "POST",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
},
body: JSON.stringify({ feed_key: feedKey })

View file

@ -1,16 +1,16 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchGlobals = async () => {
try {
const data = await EleventyFetch(`${POSTGREST_URL}/optimized_globals?select=*`, {
duration: '1d',
type: 'json',
duration: "1d",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
@ -18,7 +18,7 @@ const fetchGlobals = async () => {
return data[0];
} catch (error) {
console.error('Error fetching globals:', error);
console.error("Error fetching globals:", error);
return {};
}
};

View file

@ -1,15 +1,15 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
export default async function () {
const res = await EleventyFetch(`${POSTGREST_URL}/optimized_all_tags?order=tag.asc`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
@ -18,7 +18,7 @@ export default async function () {
const groupedMap = new Map();
for (const tag of tags) {
const letter = /^[a-zA-Z]/.test(tag.tag) ? tag.tag[0].toUpperCase() : '#';
const letter = /^[a-zA-Z]/.test(tag.tag) ? tag.tag[0].toUpperCase() : "#";
if (!groupedMap.has(letter)) groupedMap.set(letter, []);

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchHeaders = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_headers?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching header data:', error);
console.error("Error fetching header data:", error);
return [];
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllLinks = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_links?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching links:', error);
console.error("Error fetching links:", error);
return [];
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllMovies = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_movies?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching movies:', error);
console.error("Error fetching movies:", error);
return [];
}
};
@ -48,7 +48,7 @@ export default async function () {
feed: movies.filter((movie) => movie.feed)
};
} catch (error) {
console.error('Error fetching and processing movies data:', error);
console.error("Error fetching and processing movies data:", error);
return {
movies: [],
watchHistory: [],

View file

@ -1,16 +1,16 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchDataFromView = async (viewName) => {
try {
return await EleventyFetch(`${POSTGREST_URL}/${viewName}?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
@ -34,15 +34,15 @@ export default async function fetchMusicData() {
monthAlbums,
monthGenres
] = await Promise.all([
fetchDataFromView('recent_tracks'),
fetchDataFromView('week_tracks'),
fetchDataFromView('week_artists'),
fetchDataFromView('week_albums'),
fetchDataFromView('week_genres'),
fetchDataFromView('month_tracks'),
fetchDataFromView('month_artists'),
fetchDataFromView('month_albums'),
fetchDataFromView('month_genres')
fetchDataFromView("recent_tracks"),
fetchDataFromView("week_tracks"),
fetchDataFromView("week_artists"),
fetchDataFromView("week_albums"),
fetchDataFromView("week_genres"),
fetchDataFromView("month_tracks"),
fetchDataFromView("month_artists"),
fetchDataFromView("month_albums"),
fetchDataFromView("month_genres")
]);
return {
@ -52,7 +52,7 @@ export default async function fetchMusicData() {
artists: weekArtists,
albums: weekAlbums,
genres: weekGenres,
totalTracks: weekTracks.reduce((acc, track) => acc + track.plays, 0).toLocaleString('en-US')
totalTracks: weekTracks.reduce((acc, track) => acc + track.plays, 0).toLocaleString("en-US")
},
month: {
tracks: monthTracks,
@ -61,11 +61,11 @@ export default async function fetchMusicData() {
genres: monthGenres,
totalTracks: monthTracks
.reduce((acc, track) => acc + track.plays, 0)
.toLocaleString('en-US')
.toLocaleString("en-US")
}
};
} catch (error) {
console.error('Error fetching and processing music data:', error);
console.error("Error fetching and processing music data:", error);
return {
recent: [],
week: {
@ -73,14 +73,14 @@ export default async function fetchMusicData() {
artists: [],
albums: [],
genres: [],
totalTracks: '0'
totalTracks: "0"
},
month: {
tracks: [],
artists: [],
albums: [],
genres: [],
totalTracks: '0'
totalTracks: "0"
}
};
}

View file

@ -1,16 +1,16 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllNavigation = async () => {
try {
const data = await EleventyFetch(`${POSTGREST_URL}/optimized_navigation?select=*`, {
duration: '1d',
type: 'json',
duration: "1d",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
@ -40,7 +40,7 @@ const fetchAllNavigation = async () => {
return nav;
} catch (error) {
console.error('Error fetching navigation data:', error);
console.error("Error fetching navigation data:", error);
return {};
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllPages = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_pages?select=*`, {
duration: '1d',
type: 'json',
duration: "1d",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching pages:', error);
console.error("Error fetching pages:", error);
return [];
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllPosts = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_posts?select=*&order=date.desc`, {
duration: '1d',
type: 'json',
duration: "1d",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching posts:', error);
console.error("Error fetching posts:", error);
return [];
}
};

View file

@ -1,16 +1,16 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
export default async function () {
try {
const data = await EleventyFetch(`${POSTGREST_URL}/optimized_recent_activity`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
@ -20,7 +20,7 @@ export default async function () {
return feeds.filter((item) => item !== null);
} catch (error) {
console.error('Error fetching recent activity:', error);
console.error("Error fetching recent activity:", error);
return [];
}
}

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchRedirects = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_redirects?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching redirect data:', error);
console.error("Error fetching redirect data:", error);
return [];
}
};

View file

@ -1,30 +1,30 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllRobots = async () => {
try {
const data = await EleventyFetch(`${POSTGREST_URL}/optimized_robots?select=path,user_agents`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
const sortedData = data.sort((a, b) => {
const aHasWildcard = a.user_agents.includes('*') ? 0 : 1;
const bHasWildcard = b.user_agents.includes('*') ? 0 : 1;
const aHasWildcard = a.user_agents.includes("*") ? 0 : 1;
const bHasWildcard = b.user_agents.includes("*") ? 0 : 1;
return aHasWildcard - bHasWildcard || a.path.localeCompare(b.path);
});
return sortedData;
} catch (error) {
console.error('Error fetching robot data:', error);
console.error("Error fetching robot data:", error);
return [];
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchSitemap = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_sitemap?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching sitemap entries:', error);
console.error("Error fetching sitemap entries:", error);
return [];
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchStats = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_stats?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching stats data:', error);
console.error("Error fetching stats data:", error);
return [];
}
};

View file

@ -1,4 +1,4 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
@ -7,12 +7,12 @@ const fetchTopAlbums = async () => {
const data = await EleventyFetch(
`${POSTGREST_URL}/optimized_albums?select=table&order=total_plays_raw.desc&limit=8`,
{
duration: '1d',
type: 'json',
duration: "1d",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
@ -21,7 +21,7 @@ const fetchTopAlbums = async () => {
return data;
} catch (error) {
console.error('Error fetching top albums:', error);
console.error("Error fetching top albums:", error);
return {};
}
};

View file

@ -1,4 +1,4 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
@ -7,12 +7,12 @@ const fetchTopArtists = async () => {
const data = await EleventyFetch(
`${POSTGREST_URL}/optimized_artists?select=table&order=total_plays_raw.desc&limit=8`,
{
duration: '1d',
type: 'json',
duration: "1d",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
@ -21,7 +21,7 @@ const fetchTopArtists = async () => {
return data;
} catch (error) {
console.error('Error fetching top artists:', error);
console.error("Error fetching top artists:", error);
return {};
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchTopTags = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/rpc/get_top_tag_groups`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'POST',
method: "POST",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching top tag entries:', error);
console.error("Error fetching top tag entries:", error);
return [];
}
};

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchAllShows = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_shows?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching shows:', error);
console.error("Error fetching shows:", error);
return [];
}
};
@ -46,7 +46,7 @@ export default async function () {
.sort((a, b) => a.title.localeCompare(b.title))
};
} catch (error) {
console.error('Error fetching and processing shows data:', error);
console.error("Error fetching and processing shows data:", error);
return {
shows: [],

View file

@ -1,22 +1,22 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import EleventyFetch from "@11ty/eleventy-fetch";
const { POSTGREST_URL, POSTGREST_API_KEY } = process.env;
const fetchUpcomingShows = async () => {
try {
return await EleventyFetch(`${POSTGREST_URL}/optimized_scheduled_shows?select=*`, {
duration: '1h',
type: 'json',
duration: "1h",
type: "json",
fetchOptions: {
method: 'GET',
method: "GET",
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Bearer ${POSTGREST_API_KEY}`
}
}
});
} catch (error) {
console.error('Error fetching upcoming shows:', error);
console.error("Error fetching upcoming shows:", error);
return [];
}
};