This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/src/data/syndication.js

20 lines
581 B
JavaScript

import { createClient } from "@supabase/supabase-js";
const SUPABASE_URL = process.env.SUPABASE_URL;
const SUPABASE_KEY = process.env.SUPABASE_KEY;
const supabase = createClient(SUPABASE_URL, SUPABASE_KEY);
export default async function fetchSyndication() {
const { data, error } = await supabase
.from("optimized_syndication")
.select("syndication");
if (error) {
console.error("Error fetching search index data:", error);
return [];
}
const [{ syndication } = {}] = data;
return syndication?.filter((item) => item["syndication"] !== null) || [];
}