chore(*): use prettier for formatting
This commit is contained in:
parent
6c659fe1d0
commit
029caaaa9e
73 changed files with 1390 additions and 794 deletions
|
@ -1,25 +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",
|
||||
fetchOptions: {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${POSTGREST_API_KEY}`,
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
return await EleventyFetch(`${POSTGREST_URL}/optimized_posts?select=*&order=date.desc`, {
|
||||
duration: '1d',
|
||||
type: 'json',
|
||||
fetchOptions: {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${POSTGREST_API_KEY}`
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error fetching posts:", error);
|
||||
console.error('Error fetching posts:', error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
@ -29,6 +26,6 @@ export default async function () {
|
|||
|
||||
return {
|
||||
all: posts,
|
||||
feed: posts.filter((posts) => posts.feed),
|
||||
feed: posts.filter((posts) => posts.feed)
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue