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,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"
}
};
}