mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
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:
27
_data/homepageConfig.js
Normal file
27
_data/homepageConfig.js
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user