Creare contenuti con hugo e a mano con Gitea
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
resources/
|
||||||
|
.obsidian/
|
17
Home.md
@ -4,7 +4,7 @@ BENVENUTO NELLA WIKI
|
|||||||
|
|
||||||
* [Regole d'oro TL;DR](Regole-d-oro)
|
* [Regole d'oro TL;DR](Regole-d-oro)
|
||||||
|
|
||||||
**Procedure fondamentali operando da locale**
|
**Procedure fondamentali operando da locale con GIT**
|
||||||
|
|
||||||
* [Controllare e gestire l'upstream (git REMOTE)](Operazioni-fondamentali#controllare-e-gestire-lupstream-git-remote)
|
* [Controllare e gestire l'upstream (git REMOTE)](Operazioni-fondamentali#controllare-e-gestire-lupstream-git-remote)
|
||||||
* [Aggiornamento del repo locale (git FETCH)](Appunti#aggiornamento-del-repo-locale-git-fetch)
|
* [Aggiornamento del repo locale (git FETCH)](Appunti#aggiornamento-del-repo-locale-git-fetch)
|
||||||
@ -12,20 +12,19 @@ BENVENUTO NELLA WIKI
|
|||||||
* [Aggiornamento di origin/main con l'upstream (git PULL)](Operazioni-fondamentali#aggiornamento-di-originmain-con-lupstream-git-pull)
|
* [Aggiornamento di origin/main con l'upstream (git PULL)](Operazioni-fondamentali#aggiornamento-di-originmain-con-lupstream-git-pull)
|
||||||
* [Avanzamento di un branch da eseguire prima di un a PR (git PULL --REBASE)](Operazioni-fondamentali#avanzamento-di-un-branch-da-eseguire-prima-di-un-a-pr-git-pull---rebase)
|
* [Avanzamento di un branch da eseguire prima di un a PR (git PULL --REBASE)](Operazioni-fondamentali#avanzamento-di-un-branch-da-eseguire-prima-di-un-a-pr-git-pull---rebase)
|
||||||
|
|
||||||
**Link a comandi e guide**
|
**Come pubblicare i contenuti usando Hugo**
|
||||||
|
|
||||||
|
* [hugo new - creare contenuti in Locale](hugo-contrib/hugo-new.md)
|
||||||
|
* [hugo new - creare contenuti dal WEB](hugo-contrib/hugo-new-manualmente.md)
|
||||||
|
|
||||||
|
**Link a comandi e guide per GIT**
|
||||||
|
|
||||||
* [Merge](Merge)
|
* [Merge](Merge)
|
||||||
|
|
||||||
* [Branch: comandi utili](Branch)
|
* [Branch: comandi utili](Branch)
|
||||||
|
|
||||||
* [Rebase: come fare](Fare-il-rebase)
|
* [Rebase: come fare](Fare-il-rebase)
|
||||||
|
|
||||||
* [Spostare i commit](Spostare-commit)
|
* [Spostare i commit](Spostare-commit)
|
||||||
|
|
||||||
* [Diff: differenze tra le versioni con git DIFF](Diff)
|
* [Diff: differenze tra le versioni con git DIFF](Diff)
|
||||||
|
|
||||||
* [Relref - link interni](Relref)
|
* [Relref - link interni](Relref)
|
||||||
|
|
||||||
* [Link guide online](Link-guide)
|
* [Link guide online](Link-guide)
|
||||||
|
|
||||||
* [Chiavi SSH](Chiavi-SSH)
|
* [Chiavi SSH](Chiavi-SSH)
|
||||||
|
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
* [Home](Home)
|
* [Home](Home)
|
||||||
|
|
||||||
|
Come contribuire usando Gitea
|
||||||
* [Regole d'oro TL;DR](Regole-d-oro)
|
* [Regole d'oro TL;DR](Regole-d-oro)
|
||||||
* [Procedure fondamentali](Operazioni-fondamentali)
|
* [Procedure fondamentali](Operazioni-fondamentali)
|
||||||
|
|
||||||
Comandi:
|
Comandi hugo e struttura del sito
|
||||||
|
* [hugo new - creare contenuti in LOCALE](hugo-contrib/hugo-new.md)
|
||||||
|
* [hugo new - creare contenuti dal WEB](hugo-contrib/hugo-new-manualmente.md)
|
||||||
|
|
||||||
|
Comandi GIT:
|
||||||
|
|
||||||
* [Branch](Branch)
|
* [Branch](Branch)
|
||||||
* [Diff](Diff)
|
* [Diff](Diff)
|
||||||
|
BIN
hugo-contrib/gitea-PR-nuovo-contributo.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
hugo-contrib/gitea-aggiungi-file.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
hugo-contrib/gitea-aggiunta-media.png
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
hugo-contrib/gitea-cancella-file.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
hugo-contrib/gitea-carica-cartella.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
hugo-contrib/gitea-carica-max5.png
Normal file
After Width: | Height: | Size: 125 KiB |
BIN
hugo-contrib/gitea-carica-media.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
hugo-contrib/gitea-commit-online.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
hugo-contrib/gitea-crea-post.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
hugo-contrib/gitea-creare-cartella.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
hugo-contrib/gitea-creare-ramo.png
Normal file
After Width: | Height: | Size: 95 KiB |
BIN
hugo-contrib/gitea-ramo-selezionato.png
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
hugo-contrib/hugo-new-evento-tree.png
Normal file
After Width: | Height: | Size: 120 KiB |
106
hugo-contrib/hugo-new-manualmente.md
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
Se non vuoi o non puoi utilizzare Hugo in locale, puoi comunque creare contenuti per il sito come spiegato di seguito.
|
||||||
|
|
||||||
|
## Completamente online
|
||||||
|
|
||||||
|
Accedi a Gitea e al tuo fork. Crea un ramo per il contributo che intendi pubblicare e selezionalo.
|
||||||
|
|
||||||
|
### Creare il ramo dal main
|
||||||
|
|
||||||
|
Clicca la scheda dei Rami (Branch) e crea un ramo partendo dal main.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Controlla il ramo appena creato sia quello attivo e in cui creerai il contenuto.
|
||||||
|
|
||||||
|

|
||||||
|
### Creare cartella e file index.it.md
|
||||||
|
|
||||||
|
Posizionati nella cartella dentro cui vuoi creare il contenuto. Generalmente si creano contenuti nelle cartelle _content/posts_ e _content/events_. Guarda il contenuto esistente e capirai come agire per rispettare la struttura scelta per la gestione dei contenuti.
|
||||||
|
|
||||||
|

|
||||||
|
Le cartelle si creano automaticamente aggiungendo lo slash `/` in fondo al nome che hai appena scritto.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Ricorda che i file devono essere così nominati:
|
||||||
|
|
||||||
|
* index.it.md
|
||||||
|
* index.en.md
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Copia e incolla il **front matter dell'ultimo post** pubblicato o
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
title: Cercasi volontari lettura AdaZ
|
||||||
|
author: pippo
|
||||||
|
type: post
|
||||||
|
date: 2024-07-03T16:04:23+00:00
|
||||||
|
slug: volontari-lettura-adaz
|
||||||
|
aliases:
|
||||||
|
- /2024/07/03/aaa-volontari-cercasi-per-leggere-adazangemann/
|
||||||
|
image: banner-manifestazione.png
|
||||||
|
image_alt: "Un'immagine tratta dal libro Ada&Zangemann in cui ritrae delle persone che sono in marcia per manifestare a favore del software libero"
|
||||||
|
summary: BgLUG e FabLab Bergamo stanno cercando volontari per promuovere il progetto formativo proposto dalla FSFE rivolto ai bambini delle scuole primarie.
|
||||||
|
categories:
|
||||||
|
- News
|
||||||
|
- Scuola
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
**il front matter dell'ultimo evento** e personalizzalo.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
title: "2024 07 10 Evento Di Prova"
|
||||||
|
date: 2024-07-10T13:54:43+02:00
|
||||||
|
#expiryDate: # impostare se il post deve essere rimosso automaticamente nel futuro
|
||||||
|
#publishDate: # impostare se il post deve essere pubblicato automaticamente nel futuro
|
||||||
|
draft: true # false se vuoi che venga pubblicato
|
||||||
|
slug: "2024-07-10-evento-di-prova"
|
||||||
|
type: post
|
||||||
|
image: image.png # se non metti un'immagine, viene presa la prima immagine del post
|
||||||
|
image_alt: "Descrizione dell'immagine. Il ratio dell'immagine deve essere 360x250."
|
||||||
|
summary: Se non presente, usa il testo dell'articolo
|
||||||
|
tags:
|
||||||
|
- eventi
|
||||||
|
categories:
|
||||||
|
- Eventi
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
Al termine compila una descrizione per il commit e invia.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Caricare media e allegati
|
||||||
|
|
||||||
|
Carica gli allegati e i media se presenti. Puoi importali tutti insieme in un unico commit.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A questo punto il nuovo contributo e pronto per poter essere inviato cliccando l'apposito pulsante **`Nuova Pull Request`**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Per eliminare un file cliccalo e usa il cestino. Ogni cancellazione è un commit e non potrai cancellare l'intera cartella con un clic; in quel caso è più veloce cancellare l'intero ramo appena creato.
|
||||||
|
Quando hai cancellato l'ultimo file, verrà cancellata anche la cartella rimasta vuota.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Caricare una cartella di file preparata in locale
|
||||||
|
|
||||||
|
Ovviamente niente di vieta di creare tutto in locale con un editor di testo e preparare, con calma, una cartella con tutti gli allegati.
|
||||||
|
|
||||||
|
Attenzione però che:
|
||||||
|
* dovrai specificare il nome della cartella prima di confermare il commit
|
||||||
|
* spostare i file successivamente non sempre è possibile (tipo con i jpg)
|
||||||
|
* non potrai caricare più di 5 file alla volta
|
||||||
|
|
||||||
|

|
||||||
|
**Ricordati di compilare il nome della cartella** che vuoi creare e dentro cui verranno caricati i file pronti per l'upload.
|
||||||
|
|
||||||
|

|
55
hugo-contrib/hugo-new.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
## Hugo new [command]
|
||||||
|
|
||||||
|
La guida riguarda l'uso di Hugo in ambiente locale
|
||||||
|
|
||||||
|
Se vuoi creare aggiungere contenuti usando Gitea da browser [leggi qua](hugo-new-manualmente).
|
||||||
|
|
||||||
|
Per utilizzare un archetipo personalizzato, per esempio per creare un **evento**, dalla root del progetto eseguire il comando:
|
||||||
|
|
||||||
|
`hugo new events/2024-07-10-evento-di-prova -k evento`
|
||||||
|
|
||||||
|
Nella posizione indicata, in questo caso dentro la cartella _events_, verrà creata una sottocartella contenente i due file index, generati come indicato nell'archetipo **evento**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Per maggiori dettagli sul comando riferirsi alla guida `hugo new -h`
|
||||||
|
|
||||||
|
```
|
||||||
|
Create a new content file and automatically set the date and title.
|
||||||
|
It will guess which kind of file to create based on the path provided.
|
||||||
|
|
||||||
|
You can also specify the kind with `-k KIND`.
|
||||||
|
|
||||||
|
If archetypes are provided in your theme or site, they will be used.
|
||||||
|
|
||||||
|
Ensure you run this within the root directory of your site.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
hugo new content [path] [flags]
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
-b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
|
||||||
|
--cacheDir string filesystem path to cache directory
|
||||||
|
-c, --contentDir string filesystem path to content directory
|
||||||
|
--editor string edit new content with this editor, if provided
|
||||||
|
-f, --force overwrite file if it already exists
|
||||||
|
-h, --help help for content
|
||||||
|
-k, --kind string content type to create
|
||||||
|
--renderSegments strings named segments to render (configured in the segments config)
|
||||||
|
-t, --theme strings themes to use (located in /themes/THEMENAME/)
|
||||||
|
|
||||||
|
Global Flags:
|
||||||
|
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||||
|
--config string config file (default is hugo.yaml|json|toml)
|
||||||
|
--configDir string config dir (default "config")
|
||||||
|
--debug debug output
|
||||||
|
-d, --destination string filesystem path to write files to
|
||||||
|
-e, --environment string build environment
|
||||||
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
|
--logLevel string log level (debug|info|warn|error)
|
||||||
|
--quiet build in quiet mode
|
||||||
|
-M, --renderToMemory render to memory (mostly useful when running the server)
|
||||||
|
-s, --source string filesystem path to read files relative from
|
||||||
|
--themesDir string filesystem path to themes directory
|
||||||
|
-v, --verbose verbose output
|
||||||
|
```
|