Compare commits
2 commits
4c471d45b4
...
fadf7de96f
Author | SHA1 | Date | |
---|---|---|---|
fadf7de96f | |||
fba625e5d3 |
32 changed files with 409 additions and 100 deletions
.forgejo/workflows
.gitignore.trash
BigProject.canvasOrganizzazione.canvasUntitled 2.mdUntitled 3.mdUntitled 4.mdUntitled.canvasUntitled.mdmigration 2.mdmigration.md
AC.mdHistory.mdOrganization.mdPartners.mdPrivacy Policy.mdREADME.mdRaD
Rules.mdStaff.mdTerms of Service.mdindex.jsonpackage.jsonpnpm-lock.yamlscripts
38
.forgejo/workflows/update-index.yml
Normal file
38
.forgejo/workflows/update-index.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
name: Aggiorna index.json e aggiungilo alla Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
update-index:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
- name: Installa dipendenze
|
||||
run: npm ci
|
||||
|
||||
- name: Genera index.json
|
||||
run: npm run index
|
||||
|
||||
- name: Verifica modifiche in index.json
|
||||
id: check_changes
|
||||
run: |
|
||||
if git diff --quiet index.json; then
|
||||
echo "changed=false" >> $GITHUB_ENV
|
||||
else
|
||||
echo "changed=true" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Aggiungi index.json alla Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: index.json
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1 +1,5 @@
|
|||
.obsidian
|
||||
|
||||
node_modules
|
||||
index.json
|
||||
.trash
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"nodes":[
|
||||
{"id":"9840637ed72bf2f9","x":-567,"y":40,"width":250,"height":60,"type":"text","text":"Administration Council"},
|
||||
{"id":"44619cf241e1f62a","x":-619,"y":180,"width":355,"height":60,"type":"text","text":"Owner RaD"},
|
||||
{"id":"599f113a1cd1675a","x":-566,"y":320,"width":250,"height":60,"type":"text","text":""}
|
||||
],
|
||||
"edges":[
|
||||
{"id":"706c801c5baa529f","fromNode":"9840637ed72bf2f9","fromSide":"bottom","toNode":"44619cf241e1f62a","toSide":"top"}
|
||||
]
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
- [ ] Configurare IPv6
|
||||
- [ ] Configurare firewall
|
||||
- [ ] Tutte le porte chiuse tranne quelle usate da:
|
||||
- Pterodactyl
|
||||
- SSH
|
||||
- Webmin
|
||||
- Nexus
|
||||
- Email
|
||||
- [ ] Migare intero database
|
||||
- [ ] Migrare i DNS
|
||||
- [ ] Fai in modo che node1.- punti al nuovo indirizzo IP
|
||||
- [ ] Tutti gli altri record devono essere CNAME a node1.-
|
||||
- [ ] Migrare pterodactyl: [aiuto](https://gist.github.com/Software-Noob/c18258658bef28e73b24d11d02d24915?permalink_comment_id=4940946)
|
||||
- [ ] Migrare database
|
||||
- [ ] Migrare .env
|
||||
- [ ] Installare wings
|
||||
- [ ] Inserire i volumes
|
||||
- [ ] Installare sonatype nexus tramite docker: [aiuto](https://www.sonatype.com/blog/sonatype-nexus-installation-using-docker) ; come docker image usa sonatype/nexus3
|
||||
- [ ] KILLER - Settare repository NPM
|
||||
- [ ] KILLER - Settare repository Maven
|
||||
- [ ] KILLER - Rimuovere repository non usate
|
||||
- [ ] KILLER - Migrare Mail server. Al posto che postfix e dovecot usa [wildduck](https://github.com/nodemailer/wildduck-dockerized)
|
||||
- [ ] Migrare i DNS
|
||||
- [ ] Installa webmin (se non c'è di default)
|
||||
- [ ] Creare file di SWAP da 10 gb
|
|
@ -1,25 +0,0 @@
|
|||
- [ ] Configurare IPv6
|
||||
- [ ] Configurare firewall
|
||||
- [ ] Tutte le porte chiuse tranne quelle usate da:
|
||||
- Pterodactyl
|
||||
- SSH
|
||||
- Webmin
|
||||
- Nexus
|
||||
- Email
|
||||
- [ ] Migare intero database
|
||||
- [ ] Migrare i DNS
|
||||
- [ ] Fai in modo che node1.- punti al nuovo indirizzo IP
|
||||
- [ ] Tutti gli altri record devono essere CNAME a node1.-
|
||||
- [ ] Migrare pterodactyl: [aiuto](https://gist.github.com/Software-Noob/c18258658bef28e73b24d11d02d24915?permalink_comment_id=4940946)
|
||||
- [ ] Migrare database
|
||||
- [ ] Migrare .env
|
||||
- [ ] Installare wings
|
||||
- [ ] Inserire i volumes
|
||||
- [ ] Installare sonatype nexus tramite docker: [aiuto](https://www.sonatype.com/blog/sonatype-nexus-installation-using-docker) ; come docker image usa sonatype/nexus3
|
||||
- [ ] KILLER - Settare repository NPM
|
||||
- [ ] KILLER - Settare repository Maven
|
||||
- [ ] KILLER - Rimuovere repository non usate
|
||||
- [ ] KILLER - Migrare Mail server. Al posto che postfix e dovecot usa [wildduck](https://github.com/nodemailer/wildduck-dockerized)
|
||||
- [ ] Migrare i DNS
|
||||
- [ ] Installa webmin (se non c'è di default)
|
||||
- [ ] Creare file di SWAP da 10 gb
|
9
AC.md
9
AC.md
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Administration Council
|
||||
description: Informations about Thunder Network's Administration Council.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: ac
|
||||
---
|
||||
|
||||
⚠️Da aggiornare
|
||||
|
||||
Il Consiglio di Amministrazione è un gruppo di persone ad accesso ristretto. Il suo compito è prendere le decisioni nell'interesse dell'organizzazione.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: History
|
||||
description: Informations about Thunder Network's History.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: history
|
||||
---
|
||||
|
||||
> Questo documento è a scopo illustrativo.
|
||||
|
||||
Gran parte di questo documento è narrato dal punto di vista di KillerBossOriginal.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Organization
|
||||
description: Informations about Thunder Network's Organization.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: organization
|
||||
---
|
||||
|
||||
⚠️Da aggiornare
|
||||
|
||||
Thunder Network è un'organizzazione che, per semplificare la gestione, è stata suddivisa meticolosamente.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Partners
|
||||
description: Informations about Thunder Network Partners.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: partners
|
||||
---
|
||||
|
||||
⚠️Da aggiornare
|
||||
|
||||
Questo file descrive alcuni degli accordi principali con cui si può diventare Partner di Thunder Network. La revisione e la gestione delle collaborazioni è esclusiva degli **External Affairs**.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Privacy Policy
|
||||
description: Thunder Network Privacy Policy.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "true"
|
||||
slug: rules
|
||||
---
|
||||
|
||||
Ogni modifica a questo documento verrà annunciata e deve essere accettata da chiunque fornisca informazioni a Thunder Network.
|
||||
Prendiamo solo i dati richiesti dai nostri servizi per funzionare, essi includono ma non sono limitati a:
|
||||
1. Informazioni date dall'utente dentro forms e registrazioni:
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Index
|
||||
description: Thunder Network Wiki Index.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "true"
|
||||
slug: /
|
||||
---
|
||||
|
||||
Questo sito è stato creato con lo scopo di avere un sito unico e facile da gestire per mantenere tutte le documentazioni riguardanti Thunder Network (comunità e progetti).
|
||||
|
||||
- [Organizzazione](Organization.md)
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Livetar
|
||||
description: Informations about Livetar.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: rad/livetar
|
||||
---
|
||||
|
||||
> Avvertenza: Questa pagina è dedicata ad un'idea per un progetto ancora in fase di sviluppo, pertanto sia l'idea che il risultato finale possono essere modificati o scartati in qualsiasi momento.
|
||||
|
||||
Livetar sarà il primo social game al mondo, con interazioni in tempo reale tra gli utenti.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Bolty
|
||||
description: Informations about Bolty.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "true"
|
||||
slug: rad/bolty
|
||||
---
|
||||
|
||||

|
||||
Bolty è un personaggio nato da un fulmine.
|
||||
Lo abbiamo assunto come mascotte di Thunder Network e segue tutti gli utenti, adesso però riesce a viaggiare solo tramite Discord.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Internet Avatar
|
||||
description: Informations about Internet Avatar.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: rad/internet-avatar
|
||||
---
|
||||
|
||||
> Avvertenza: Questa pagina è dedicata ad un'idea per un progetto ancora in fase di sviluppo, pertanto sia l'idea che il risultato finale possono essere modificati o scartati in qualsiasi momento.
|
||||
|
||||
Internet Avatar è stato pensato come un sistema per riunire molteplici account.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Database in Lighting Repositories
|
||||
description: Informations about database usage in the Lighting Repositories.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: rad/lr/database
|
||||
---
|
||||
|
||||
Il database serve per salvare una lista di tutti i file salvati dentro il sistema.
|
||||
Schema:
|
||||
```json
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Lighting Repositories
|
||||
description: Informations about Lighting Repositories.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: rad/lr
|
||||
---
|
||||
|
||||
# Proxy
|
||||
Il proxy reindirizza le richieste allo sharder che contiene l'host del file, e aspetta che gli venga inviato il file. Ha un ip pubblico.
|
||||
Se il filer che contiene il file ha un ip pubblico manda direttamente la richiesta al filer.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Matrix OS
|
||||
description: Informations about Matrix OS.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: rad/matrix-os
|
||||
---
|
||||
|
||||
> Avvertenza: Questa pagina è dedicata ad un'idea per un progetto ancora in fase di sviluppo, pertanto sia l'idea che il risultato finale possono essere modificati o scartati in qualsiasi momento.
|
||||
|
||||
Funzionalità:
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Research and Development
|
||||
description: Informations about ThunderNetworkRaD.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "true"
|
||||
slug: RaD
|
||||
---
|
||||
|
||||
anche noto come *Ricerca e Sviluppo* (dall'inglese *Research and Development*), è la branca che si occupa dello sviluppo di nuovi progetti tecnologici, scientifici ed informatici, tra cui [Bolty](Bolty.md) e Internet Avatar.
|
||||
|
||||
A febbraio 2024 questa branca è stata suddivisa in 2 gruppi che si occupano collaborando tra esse per la realizzazione dei nostri progetti.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: The Mind
|
||||
description: Informations about The Mind.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "false"
|
||||
slug: rad/the-mind
|
||||
---
|
||||
|
||||
> Avvertenza: Questa pagina è dedicata ad un'idea per un progetto ancora in fase di sviluppo, pertanto sia l'idea che il risultato finale possono essere modificati o scartati in qualsiasi momento.
|
||||
|
||||
The Mind è un server HTTP che funzionerà come cervello centrale per i prodotti di Thunder Network.
|
||||
|
|
9
Rules.md
9
Rules.md
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Rules
|
||||
description: Rules for the community.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "true"
|
||||
slug: rules
|
||||
---
|
||||
|
||||
| Ultimo aggiornamento | 02/12/2024 |
|
||||
| -------------------- | ---------- |
|
||||
| In vigore da | 02/11/2024 |
|
||||
|
|
9
Staff.md
9
Staff.md
|
@ -1,3 +1,12 @@
|
|||
---
|
||||
title: Staff
|
||||
description: Informations about Thunder Network Staff.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "true"
|
||||
slug: staff
|
||||
---
|
||||
|
||||
In questo documento sono raggruppate tutte le regole dello staff.
|
||||
# Adesione
|
||||
Vuoi diventare un membro dello staff di Thunder Network?
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
---
|
||||
title: Terms of Service
|
||||
description: I nostri termini di servizio.
|
||||
image:
|
||||
date: 2025.02.16T18.00.00.000Z
|
||||
public: "true"
|
||||
slug: terms
|
||||
---
|
||||
|
||||
| Ultimo aggiornamento | 02/12/2024 |
|
||||
| -------------------- | ---------- |
|
||||
|
|
98
index.json
98
index.json
|
@ -1,40 +1,58 @@
|
|||
{
|
||||
"public": [
|
||||
{
|
||||
"title": "Index",
|
||||
"path": "README.md",
|
||||
"slug": "index",
|
||||
"type": "md"
|
||||
},
|
||||
{
|
||||
"title": "RaD",
|
||||
"path": "RaD/RaD.md",
|
||||
"slug": "RaD",
|
||||
"type": "md"
|
||||
},
|
||||
{
|
||||
"title": "Bolty",
|
||||
"path": "RaD/Bolty.md",
|
||||
"slug": "bolty",
|
||||
"type": "md"
|
||||
},
|
||||
{
|
||||
"title": "Rules",
|
||||
"path": "Rules.md",
|
||||
"slug": "rules",
|
||||
"type": "md"
|
||||
},
|
||||
{
|
||||
"title": "Terms of Service",
|
||||
"path": "Terms%20of%20Service.md",
|
||||
"slug": "tos",
|
||||
"type": "md"
|
||||
},
|
||||
{
|
||||
"title": "Privacy Policy",
|
||||
"path": "Privacy%20Policy.md",
|
||||
"slug": "privacy",
|
||||
"type": "md"
|
||||
}
|
||||
]
|
||||
}
|
||||
[
|
||||
{
|
||||
"slug": "rules",
|
||||
"title": "Privacy Policy",
|
||||
"description": "Thunder Network Privacy Policy.",
|
||||
"image": null,
|
||||
"date": "2025.02.16T18.00.00.000Z",
|
||||
"public": "true"
|
||||
},
|
||||
{
|
||||
"slug": "rad/bolty",
|
||||
"title": "Bolty",
|
||||
"description": "Informations about Bolty.",
|
||||
"image": null,
|
||||
"date": "2025.02.16T18.00.00.000Z",
|
||||
"public": "true"
|
||||
},
|
||||
{
|
||||
"slug": "RaD",
|
||||
"title": "Research and Development",
|
||||
"description": "Informations about ThunderNetworkRaD.",
|
||||
"image": null,
|
||||
"date": "2025.02.16T18.00.00.000Z",
|
||||
"public": "true"
|
||||
},
|
||||
{
|
||||
"slug": "/",
|
||||
"title": "Index",
|
||||
"description": "Thunder Network Wiki Index.",
|
||||
"image": null,
|
||||
"date": "2025.02.16T18.00.00.000Z",
|
||||
"public": "true"
|
||||
},
|
||||
{
|
||||
"slug": "rules",
|
||||
"title": "Rules",
|
||||
"description": "Rules for the community.",
|
||||
"image": null,
|
||||
"date": "2025.02.16T18.00.00.000Z",
|
||||
"public": "true"
|
||||
},
|
||||
{
|
||||
"slug": "staff",
|
||||
"title": "Staff",
|
||||
"description": "Informations about Thunder Network Staff.",
|
||||
"image": null,
|
||||
"date": "2025.02.16T18.00.00.000Z",
|
||||
"public": "true"
|
||||
},
|
||||
{
|
||||
"slug": "terms",
|
||||
"title": "Terms of Service",
|
||||
"description": "I nostri termini di servizio.",
|
||||
"image": null,
|
||||
"date": "2025.02.16T18.00.00.000Z",
|
||||
"public": "true"
|
||||
}
|
||||
]
|
14
package.json
Normal file
14
package.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "docs",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"index": "node scripts/index.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"gray-matter": "^4.0.3"
|
||||
}
|
||||
}
|
91
pnpm-lock.yaml
generated
Normal file
91
pnpm-lock.yaml
generated
Normal file
|
@ -0,0 +1,91 @@
|
|||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
gray-matter:
|
||||
specifier: ^4.0.3
|
||||
version: 4.0.3
|
||||
|
||||
packages:
|
||||
|
||||
argparse@1.0.10:
|
||||
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
|
||||
|
||||
esprima@4.0.1:
|
||||
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
|
||||
engines: {node: '>=4'}
|
||||
hasBin: true
|
||||
|
||||
extend-shallow@2.0.1:
|
||||
resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
gray-matter@4.0.3:
|
||||
resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==}
|
||||
engines: {node: '>=6.0'}
|
||||
|
||||
is-extendable@0.1.1:
|
||||
resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
js-yaml@3.14.1:
|
||||
resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
|
||||
hasBin: true
|
||||
|
||||
kind-of@6.0.3:
|
||||
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
section-matter@1.0.0:
|
||||
resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
sprintf-js@1.0.3:
|
||||
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
|
||||
|
||||
strip-bom-string@1.0.0:
|
||||
resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
snapshots:
|
||||
|
||||
argparse@1.0.10:
|
||||
dependencies:
|
||||
sprintf-js: 1.0.3
|
||||
|
||||
esprima@4.0.1: {}
|
||||
|
||||
extend-shallow@2.0.1:
|
||||
dependencies:
|
||||
is-extendable: 0.1.1
|
||||
|
||||
gray-matter@4.0.3:
|
||||
dependencies:
|
||||
js-yaml: 3.14.1
|
||||
kind-of: 6.0.3
|
||||
section-matter: 1.0.0
|
||||
strip-bom-string: 1.0.0
|
||||
|
||||
is-extendable@0.1.1: {}
|
||||
|
||||
js-yaml@3.14.1:
|
||||
dependencies:
|
||||
argparse: 1.0.10
|
||||
esprima: 4.0.1
|
||||
|
||||
kind-of@6.0.3: {}
|
||||
|
||||
section-matter@1.0.0:
|
||||
dependencies:
|
||||
extend-shallow: 2.0.1
|
||||
kind-of: 6.0.3
|
||||
|
||||
sprintf-js@1.0.3: {}
|
||||
|
||||
strip-bom-string@1.0.0: {}
|
52
scripts/index.js
Normal file
52
scripts/index.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const matter = require('gray-matter');
|
||||
|
||||
// Cartella base del progetto
|
||||
const docsDir = path.join(__dirname, '..');
|
||||
|
||||
// Nome della cartella da escludere
|
||||
const excludedDir = ['.trash', "node_modules"];
|
||||
|
||||
function generateIndex() {
|
||||
// Funzione ricorsiva per cercare tutti i file .md, escludendo `.trash`
|
||||
function findMdFiles(dir) {
|
||||
const files = fs.readdirSync(dir);
|
||||
const mdFiles = [];
|
||||
|
||||
files.forEach(file => {
|
||||
const filePath = path.join(dir, file);
|
||||
const stats = fs.statSync(filePath);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
// Escludi la cartella .trash
|
||||
if (!excludedDir.includes(file)) {
|
||||
mdFiles.push(...findMdFiles(filePath));
|
||||
}
|
||||
} else if (path.extname(file) === '.md') {
|
||||
// Se è un file .md, aggiungilo alla lista
|
||||
mdFiles.push(filePath);
|
||||
}
|
||||
});
|
||||
|
||||
return mdFiles;
|
||||
}
|
||||
|
||||
// Crea l'array di oggetti per l'indice
|
||||
const index = findMdFiles(docsDir).map(file => {
|
||||
const content = fs.readFileSync(file, 'utf8');
|
||||
const { data } = matter(content);
|
||||
|
||||
return {
|
||||
slug: data.slug || file.replace(docsDir, '').replace(/\.md$/, '').replace(/ /g, "%20").slice(1), // Rimuove il percorso assoluto e i separatori iniziali
|
||||
...data
|
||||
};
|
||||
}).filter(post => post.public === "true");
|
||||
|
||||
// Scrive l'array nel file index.json (formattato in modo leggibile)
|
||||
const indexPath = path.join(__dirname, '../index.json');
|
||||
fs.writeFileSync(indexPath, JSON.stringify(index, null, 2));
|
||||
console.log('index.json aggiornato con successo.');
|
||||
}
|
||||
|
||||
generateIndex();
|
Loading…
Add table
Reference in a new issue