From f8a624f2538c42db00f5fece7d7663edb5ecf6ce Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Wed, 6 May 2026 14:27:49 +0200 Subject: [PATCH] adding info from telegram group --- src/content/index/i.bonsai.md | 43 +++++++++++++++--------- src/pages/entries/index.astro | 61 ++++++++++++++++++++++++++++------- src/pages/index.astro | 48 ++++++++++++++++----------- 3 files changed, 105 insertions(+), 47 deletions(-) diff --git a/src/content/index/i.bonsai.md b/src/content/index/i.bonsai.md index 8f4672a..84c49d3 100644 --- a/src/content/index/i.bonsai.md +++ b/src/content/index/i.bonsai.md @@ -3,28 +3,39 @@ title: Bincio Wiki --- - [[BincioTech]] - - Gear e accessori - - Componenti e upgrade - - Tecnologia e elettronica + - [[scelta-bici]] + - [[carbonio-vs-alluminio]] + - [[marchi-e-brand]] + - [[ruote-e-cerchi]] + - [[trasmissione-e-catena]] + - [[copertoni-tubeless]] + - [[attrezzatura-gravel]] + - [[accessori-gadget]] + - [[gps-e-ciclocomputer]] + - [[app-e-servizi]] + - [[trasmissioni-tv]] + - [[film-podcast]] - [[BincioActivity]] - [[BincioOfficina]] - - Manutenzione - - Riparazioni - - Fai da te + - [[freni-a-disco]] + - [[manutenzione-cambio]] + - [[meccanica-base]] - [[BincioTour]] - - Tour report - - Bike packing - - Rotte e itinerari - - Logistica + - [[strade-e-percorsi]] + - [[bikepacking]] + - [[commuting]] + - [[uscite-bincio]] + - [[regolamentazioni]] + - [[mercato-usato]] - [[BincioCorsa]] - - Allenamento - - Gare e competizioni - - Performance - [[BincioAbbigliamento]] - - Abbigliamento tecnico - - Comfort e protezione - - Stagionalità + +- Documentazione + - [[come-funziona-il-giardino]] + - [[come-usare-le-categorie]] + - [[markdown]] + - [[wikirefs]] diff --git a/src/pages/entries/index.astro b/src/pages/entries/index.astro index 3ff6dd5..eb764bb 100644 --- a/src/pages/entries/index.astro +++ b/src/pages/entries/index.astro @@ -3,34 +3,71 @@ import Base from '../../layouts/Base.astro'; import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts'; import { getCollection } from 'astro:content'; +const SECTIONS = [ + { slug: 'bincio-tech', label: 'BincioTech', desc: 'Tecnologia, gadget e componenti' }, + { slug: 'bincio-officina', label: 'BincioOfficina', desc: 'Manutenzione e riparazioni' }, + { slug: 'bincio-tour', label: 'BincioTour', desc: 'Tour, bike packing e rotte' }, + { slug: 'bincio-corsa', label: 'BincioCorsa', desc: 'Allenamento e gare' }, + { slug: 'bincio-abbigliamento', label: 'BincioAbbigliamento', desc: 'Abbigliamento tecnico' }, +]; + const allEntries = await getCollection('entries'); -const wikiEntries = allEntries - .filter(e => !e.id.startsWith('_')) - .sort((a, b) => (b.data.updatedDate ?? b.data.pubDate ?? new Date(0)).valueOf() - - (a.data.updatedDate ?? a.data.pubDate ?? new Date(0)).valueOf()); - +const bySection: Record = Object.fromEntries(SECTIONS.map(s => [s.slug, []])); +const uncategorized: typeof allEntries = []; const docEntries = allEntries .filter(e => e.id.startsWith('_docs/')) .sort((a, b) => a.data.title.localeCompare(b.data.title)); + +for (const entry of allEntries) { + if (entry.id.startsWith('_')) continue; + const sec = SECTIONS.find(s => entry.id.startsWith(s.slug + '/')); + if (sec) bySection[sec.slug].push(entry); + else uncategorized.push(entry); +} + +for (const key of Object.keys(bySection)) { + bySection[key].sort((a, b) => a.data.title.localeCompare(b.data.title)); +} ---
-

Tutte le pagine

+

Pagine

- {wikiEntries.length === 0 ? ( -

Nessuna pagina ancora.

- ) : ( -
+ {SECTIONS.map(sec => bySection[sec.slug].length > 0 && ( +
+

{sec.label}

+

{sec.desc}

+
+ ))} + + {uncategorized.length > 0 && ( +
+

Senza categoria

+
- {wikiEntries.length > 0 ? ( -
-

Pagine recenti

+ {SECTIONS.map(sec => bySection[sec.slug].length > 0 && ( +
+

{sec.label}

+

{sec.desc}

-

- Tutte le pagine → -

- ) : ( -
-

Nessuna pagina ancora.

-
- )} + ))} {docEntries.length > 0 && (

Documentazione

-

Come funziona questo wiki

+

Come funziona questo wiki

    {docEntries.map(entry => (