diff --git a/index.js b/index.js index 902a510..59b3a35 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ import Metalsmith from 'metalsmith' import layouts from '@metalsmith/layouts' import markdown from '@metalsmith/markdown' import permalinks from '@metalsmith/permalinks' +import collections from '@metalsmith/collections' const __dirname = dirname(fileURLToPath(import.meta.url)) const t1 = performance.now() @@ -17,14 +18,6 @@ const sitedata = { contact: 'contact@lowtechlabgrenoble.org', address: '48 Ave. Washington, 38100 Grenoble' }, - nav: [ - { path: 'index.html', label: 'Accueil' }, - { path: 'actions.html', label: 'Actions' }, - { path: 'contact.html', label: 'Contact' }, - { path: 'faq.html', label: 'FAQ' }, - { path: 'ressources.html', label: 'Ressources' }, - { path: 'blog.html', label: 'Blog' } - ], socials: { twitter: 'https://twitter.com/johndoe', facebook: 'https://facebook.com/johndoe', @@ -44,6 +37,12 @@ Metalsmith(__dirname) }) .metadata(sitedata) .use(markdown()) + .use(collections({ + nav: { + pattern: '**/*.html', + sortBy: 'nav_order' + } + })) .use(permalinks()) .use(layouts({ directory: 'layouts', diff --git a/layouts/default.hbs b/layouts/default.hbs index 7e5505f..ab70cf9 100644 --- a/layouts/default.hbs +++ b/layouts/default.hbs @@ -8,6 +8,7 @@ {{ site.subject }} — {{ title }} + @@ -15,6 +16,7 @@ @@ -22,17 +24,14 @@
Logo du {{ site.subject }}
-

{{ title }}

+

{{ title }}

{{{ contents }}} {{!-- {{#if postlist}}