Skip to content

Commit 61ec124

Browse files
committed
Add aep-2026 support
1 parent 45a2534 commit 61ec124

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

CLAUDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The site generator requires external repositories to be cloned and referenced vi
2222
export AEP_LOCATION="../aeps" # Main AEP documentation repo
2323
export AEP_LINTER_LOC="../api-linter" # API linter rules repo
2424
export AEP_COMPONENTS_LOC="../aep-components" # Components repo
25+
export AEP_EDITION_2026="../aeps-2026" # (Optional) 2026 edition AEP repo
2526
npm run generate
2627
npm run dev
2728
```
@@ -35,9 +36,10 @@ This is a two-stage site generator built on Astro and Starlight:
3536
### Stage 1: Generator (`scripts/generate.ts`)
3637

3738
- Reads documentation from multiple external repos (aeps, api-linter, aep-components)
39+
- Optionally processes AEP Edition 2026 content when `AEP_EDITION_2026` is set
3840
- Transforms AEP content (formatted as Markdown with Jinja2) and custom syntax into MDX
3941
- Generates sidebar configuration and navigation
40-
- Outputs processed files to `src/content/docs/` and `generated/`
42+
- Outputs processed files to `src/content/docs/` (and `src/content/docs/aep-2026/` for 2026 edition) and `generated/`
4143

4244
### Stage 2: Starlight Site
4345

@@ -102,6 +104,7 @@ Run tests with `npm test`. Tests use a custom test runner and cover:
102104
## Generated Files
103105

104106
- `src/content/docs/` - Site content (MDX files)
107+
- `src/content/docs/aep-2026/` - AEP Edition 2026 content (MDX files, if `AEP_EDITION_2026` is set)
105108
- `generated/` - JSON configuration files (sidebar, redirects, etc.)
106109
- `public/llms.txt` - Consolidated AEP content for LLM training/reference
107110
- `public/json-schema/` - JSON schemas from components repo

scripts/generate.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const AEP_LOC = process.env.AEP_LOCATION || "";
2222
const AEP_LINTER_LOC = process.env.AEP_LINTER_LOC || "";
2323
const AEP_OPENAPI_LINTER_LOC = process.env.AEP_OPENAPI_LINTER_LOC || "";
2424
const AEP_COMPONENTS = process.env.AEP_COMPONENTS_LOC || "";
25+
const AEP_EDITION_2026 = process.env.AEP_EDITION_2026 || "";
2526

2627
// Logging functions
2728
function logFolderDetection() {
@@ -79,6 +80,19 @@ function logFolderDetection() {
7980
);
8081
}
8182

83+
if (AEP_EDITION_2026) {
84+
console.log(`✓ AEP Edition 2026 folder found: ${AEP_EDITION_2026}`);
85+
if (fs.existsSync(AEP_EDITION_2026)) {
86+
console.log(` - Path exists and is accessible`);
87+
} else {
88+
console.log(` - ⚠️ Path does not exist`);
89+
}
90+
} else {
91+
console.log(
92+
`✗ AEP Edition 2026 folder not configured (AEP_EDITION_2026 environment variable)`,
93+
);
94+
}
95+
8296
console.log("");
8397
}
8498

@@ -642,4 +656,30 @@ if (AEP_COMPONENTS != "") {
642656
}
643657
}
644658

659+
if (AEP_EDITION_2026 != "") {
660+
console.log("=== Processing AEP Edition 2026 ===");
661+
// Build out AEPs from the 2026 edition
662+
const aep_folders_2026 = await getFolders(
663+
path.join(AEP_EDITION_2026, "aep/general/"),
664+
);
665+
for (var folder of aep_folders_2026) {
666+
try {
667+
const files = readAEP(folder);
668+
const aep = buildAEP(files, folder);
669+
670+
// Write to aep-2026 directory instead of root
671+
aep.contents.frontmatter.slug = aep.id.toString();
672+
const filePath = path.join("src/content/docs/aep-2026", `${aep.id}.mdx`);
673+
writeFile(filePath, aep.contents.build());
674+
675+
console.log(`✓ Processed AEP-${aep.id} for 2026 edition`);
676+
} catch (e) {
677+
console.log(`AEP ${folder} failed with error ${e}`);
678+
}
679+
}
680+
console.log("✅ AEP Edition 2026 processing complete\n");
681+
} else {
682+
console.log("ℹ️ AEP Edition 2026 repo not configured, skipping...\n");
683+
}
684+
645685
writeSidebar(sidebar, "sidebar.json");

0 commit comments

Comments
 (0)