diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index f62dcc0..1b4d72c 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -7,14 +7,13 @@
-
Catégories
+
Pages
- Accueil
{{ if .Site.Data.wordpress }}
- {{ $count := 0 }}
{{ range $index, $element := .Site.Data.wordpress.navigation }}
- -
- {{ $element.title }}
+
-
+ {{ $element.title }}
{{ end }}
{{ end }}
diff --git a/scripts/generate-content.js b/scripts/generate-content.js
index aa48178..27d5c45 100644
--- a/scripts/generate-content.js
+++ b/scripts/generate-content.js
@@ -19,8 +19,8 @@ function generateContent() {
fs.mkdirSync(PAGES_DIR, { recursive: true });
}
- // Process posts
- posts.forEach(post => {
+ // Process posts - only include published posts
+ posts.filter(post => post.status === 'publish').forEach(post => {
const slug = post.slug;
const date = new Date(post.date);
const year = date.getFullYear();
@@ -40,7 +40,7 @@ function generateContent() {
const frontmatter = {
title: he.decode(post.title.rendered),
date: post.date,
- draft: post.status !== 'publish',
+ draft: false,
slug: slug,
wordpress_id: post.id,
excerpt: he.decode(post.excerpt.rendered.replace(/<[^>]*>/g, '')),
@@ -80,8 +80,8 @@ ${contentHtml.trim()}`;
fs.writeFileSync(path.join(contentDir, 'index.md'), content);
});
- // Process pages
- pages.forEach(page => {
+ // Process pages - only include published pages
+ pages.filter(page => page.status === 'publish').forEach(page => {
const slug = page.slug;
const contentDir = path.join(PAGES_DIR, slug);
@@ -98,7 +98,7 @@ ${contentHtml.trim()}`;
wordpress_id: page.id,
date: page.date,
modified: page.modified,
- draft: page.status !== 'publish',
+ draft: false,
aliases: [`/${slug}/`]
};
@@ -131,8 +131,10 @@ ${contentHtml.trim()}`;
fs.writeFileSync(path.join(contentDir, 'index.md'), content);
});
- console.log(`✅ Generated ${posts.length} content files`);
- console.log(`✅ Generated ${pages.length} page files`);
+ const publishedPosts = posts.filter(post => post.status === 'publish');
+ const publishedPages = pages.filter(page => page.status === 'publish');
+ console.log(`✅ Generated ${publishedPosts.length} content files`);
+ console.log(`✅ Generated ${publishedPages.length} page files`);
}
generateContent();
\ No newline at end of file