diff --git a/src/_data/links.js b/src/_data/links.js index d83b777..c45a84f 100644 --- a/src/_data/links.js +++ b/src/_data/links.js @@ -94,5 +94,6 @@ const fetchLatest = async (cache = []) => { } export default async function() { - return await fetchLatest(cachedContent()); + return []; + // return await fetchLatest(cachedContent()); } \ No newline at end of file diff --git a/src/_data/postMetrics.js b/src/_data/postMetrics.js index fe62588..3da1ab7 100644 --- a/src/_data/postMetrics.js +++ b/src/_data/postMetrics.js @@ -10,6 +10,7 @@ export default async function(arg) { url.searchParams.append("startAt", 0); url.searchParams.append("endAt", Date.now()); url.searchParams.append("type", "url"); + try { const metrics = await EleventyFetch(url.toString(), { duration: '1h', @@ -18,10 +19,14 @@ export default async function(arg) { headers: { "Authorization": `Bearer ${apiKey}`, "Accept": "application/json" - } - } + }, + }, }) return metrics.filter(metric => postRegex.test(metric.x)) .map(({ x, y }) => ({ post: x, count: y })); + } catch (e) { + console.error(e); + return []; + } } \ No newline at end of file