Articles

Hugo

April 3, 2022

Installazione

snap install hugo –channel=extended 

(la versione base ha un bug)

Per vedere la versione

hugo -version

Uso:

Creare un nuovo sito

hugo new site pingu 

(pingu=none del sito)

File di configurazione

config.toml 

Aggiungere un tema (es.ananke)

cd pingu 
git init 
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke 

Oppure scaricarlo da https://themes.gohugo.io/

Salvarlo nella cartella themes del sito e rinominarlo ananke (in questo esempio)

Aggiungere il tema nel file di configurazione confog.toml

echo theme = \"ananke\" >> config.toml 

(si può anche editare direttamente il file)

Aggiungere un tema come submodule

$ cd Project_Directory 

$ git init 

$ git submodule add https://github.com THEME_CREATOR/THEME_NAME 

Avviare il server

hugo server –D 

L’opzione D serve per visualizzare i post draft (che è impostato di default)

Aggiornare la pagina modificata

hugo –D