Raw index.md now includes home.md and footer.md content

This commit is contained in:
Wayne Sutton
2026-01-03 20:46:55 -08:00
parent cb2875a830
commit f377a3dde2
11 changed files with 236 additions and 8 deletions

View File

@@ -476,9 +476,21 @@ function generateHomepageIndex(posts: ParsedPost[], pages: ParsedPage[]): void {
return new Date(b.date).getTime() - new Date(a.date).getTime();
});
// Find the home-intro page for homepage content
const homeIntroPage = publishedPages.find((p) => p.slug === "home-intro");
// Find the footer page for footer content
const footerPage = publishedPages.find((p) => p.slug === "footer");
// Build markdown content
let markdown = `# Homepage\n\n`;
markdown += `This is the homepage index of all published content.\n\n`;
// Include home intro content if available
if (homeIntroPage && homeIntroPage.content) {
markdown += `${homeIntroPage.content}\n\n`;
markdown += `---\n\n`;
} else {
markdown += `This is the homepage index of all published content.\n\n`;
}
// Add posts section
if (sortedPosts.length > 0) {
@@ -528,6 +540,12 @@ function generateHomepageIndex(posts: ParsedPost[], pages: ParsedPage[]): void {
markdown += `**Total Content:** ${sortedPosts.length} posts, ${publishedPages.length} pages\n`;
markdown += `\nAll content is available as raw markdown files at \`/raw/{slug}.md\`\n`;
// Add footer content if available
if (footerPage && footerPage.content) {
markdown += `\n---\n\n`;
markdown += `${footerPage.content}\n`;
}
// Write index.md file
const indexPath = path.join(RAW_OUTPUT_DIR, "index.md");
fs.writeFileSync(indexPath, markdown);