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>
This commit is contained in:
rmdes
2026-02-08 15:16:29 +01:00
parent e8d7b29a4b
commit 32aea5ace9
27 changed files with 738 additions and 540 deletions

27
_data/homepageConfig.js Normal file
View File

@@ -0,0 +1,27 @@
/**
* Homepage Configuration Data
* Reads config from indiekit-endpoint-homepage plugin (when installed).
* Falls back to null — home.njk then uses the default layout.
*
* Future: The homepage plugin will write a .indiekit/homepage.json file
* that Eleventy watches. On change, a rebuild picks up the new config,
* allowing layout changes without a Docker rebuild.
*/
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
const CONTENT_DIR = process.env.CONTENT_DIR || "/data/content";
export default function () {
try {
const configPath = resolve(CONTENT_DIR, ".indiekit", "homepage.json");
const raw = readFileSync(configPath, "utf8");
const config = JSON.parse(raw);
console.log("[homepageConfig] Loaded plugin config");
return config;
} catch {
// No homepage plugin config — this is the normal case for most deployments
return null;
}
}