diff --git a/docs/zfs-replication-nfs/index.md b/docs/zfs-replication-nfs.md similarity index 100% rename from docs/zfs-replication-nfs/index.md rename to docs/zfs-replication-nfs.md diff --git a/i18n/en/docusaurus-plugin-content-docs/current/zfs-replication-nfs/index.md b/i18n/en/docusaurus-plugin-content-docs/current/zfs-replication-nfs.md similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/zfs-replication-nfs/index.md rename to i18n/en/docusaurus-plugin-content-docs/current/zfs-replication-nfs.md diff --git a/plugins/docusaurus-plugin-recent-articles/index.js b/plugins/docusaurus-plugin-recent-articles/index.js index 108adb4..1257a49 100644 --- a/plugins/docusaurus-plugin-recent-articles/index.js +++ b/plugins/docusaurus-plugin-recent-articles/index.js @@ -74,14 +74,30 @@ module.exports = function pluginRecentArticles(context, options) { const recentBlog = blogArticles.slice(0, 3); const recentDocs = docArticles.slice(0, 3); - // Intercalate blog and documentation articles: blog, doc, blog, doc, blog, doc + // Determine which type has the most recent content + const mostRecentBlog = recentBlog.length > 0 ? new Date(recentBlog[0].date) : new Date(0); + const mostRecentDoc = recentDocs.length > 0 ? new Date(recentDocs[0].date) : new Date(0); + const startWithBlog = mostRecentBlog >= mostRecentDoc; + + // Intercalate blog and documentation articles, starting with the most recent type const articles = []; for (let i = 0; i < Math.max(recentBlog.length, recentDocs.length); i++) { - if (i < recentBlog.length) { - articles.push(recentBlog[i]); - } - if (i < recentDocs.length) { - articles.push(recentDocs[i]); + if (startWithBlog) { + // Start with blog: blog, doc, blog, doc, blog, doc + if (i < recentBlog.length) { + articles.push(recentBlog[i]); + } + if (i < recentDocs.length) { + articles.push(recentDocs[i]); + } + } else { + // Start with doc: doc, blog, doc, blog, doc, blog + if (i < recentDocs.length) { + articles.push(recentDocs[i]); + } + if (i < recentBlog.length) { + articles.push(recentBlog[i]); + } } } diff --git a/sidebars.ts b/sidebars.ts index a657a8a..8b84c93 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -61,17 +61,7 @@ const sidebars: SidebarsConfig = { 'homelab-futur/cluster-3-noeuds-proxmox', ], }, - { - type: 'category', - label: 'Infrastructure de stockage', - link: { - type: 'doc', - id: 'zfs-replication-nfs/index', - }, - items: [ - 'zfs-replication-nfs/index', - ], - }, + 'zfs-replication-nfs', ], };