Files
blog-eleventy-indiekit/_data/podrollStatus.js
rmdes 32aea5ace9 feat: neutralize theme for fresh deployments
Strip personal data from templates so the theme ships clean for any
deployer. Collection pages now use generatePageOnEmptyData so empty
post types show encouraging placeholders instead of 404s. Navigation
is conditional on enabled post types and installed plugins. Sidebar
widgets split into individual components with plugin-aware visibility.
Slashes page explains required plugins for root-level page creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:16:29 +01:00

35 lines
871 B
JavaScript

/**
* Podroll Status Data
* Checks if the podroll API backend is available at build time.
* Used for conditional navigation — the podroll page itself loads data client-side.
*/
import EleventyFetch from "@11ty/eleventy-fetch";
const INDIEKIT_URL = process.env.SITE_URL || "https://example.com";
export default async function () {
try {
const url = `${INDIEKIT_URL}/podrollapi/api/status`;
console.log(`[podrollStatus] Checking API: ${url}`);
const data = await EleventyFetch(url, {
duration: "15m",
type: "json",
});
console.log("[podrollStatus] API available");
return {
available: true,
source: "indiekit",
...data,
};
} catch (error) {
console.log(
`[podrollStatus] API unavailable: ${error.message}`
);
return {
available: false,
source: "unavailable",
};
}
}