Création d'un site .rst
Nous parcourons le processus de création d'un nouveau sous-répertoire de site dans notre dépôt git afin de documenter les étapes de démarrage d'un nouveau site.
Ceci ne couvre pas la création réelle de l'infrastructure d'hébergement dans bunny.net. Nous ne passons donc par aucune étape relative à la publication dans cet exemple.
mypelican_static_sites est le projet de dépôt git où nous le configurons.
Nous créons un nouveau site appelé : dummy.bernatchez.net
Créer le nouveau répertoire du site et le peupler
# créer
cd ${HOME}/repos/mypelican_static_sites
mkdir dummy.bernatchez.net
# peupler
cp -r -P init.files/* dummy.bernatchez.net/
Ajouter ces nouveaux fichiers propres au site au contrôle de révision git
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net
# les ajouts git sont à déterminer
Référencer les articles pelican/ préexistants dans notre site factice
Il suffit que le répertoire existe sous content/ pour cela. Le Makefile se charge de peupler le sous-répertoire.
Nous allons ajouter un fichier placeholder.txt dans ce répertoire afin que git clone crée le sous-répertoire à l'avenir.
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net
mkdir content/pelican
# ceci assure que le répertoire pelican/ sera créé lors des futurs git clone
cp content/pages/placeholder.txt content/pelican/placeholder.txt
git add content/pelican/placeholder.txt
Ajouter les lignes suivantes à la fin de « .gitignore »
cd ${HOME}/repos/mypelican_static_sites
cat >>.gitignore <<EOFGITIGNORE
##
## BEGIN added for a new site
##
# dummy.bernatchez.net softlinks
dummy.bernatchez.net/content/favicon.ico
dummy.bernatchez.net/content/images/
dummy.bernatchez.net/content/site-only/
dummy.bernatchez.net/content/pages/
dummy.bernatchez.net/content/pelican/
dummy.bernatchez.net/content/images/*
dummy.bernatchez.net/content/site-only/*
dummy.bernatchez.net/content/pages/*
dummy.bernatchez.net/content/pelican/*
# dummy.bernatchez.net bucket is all generated
dummy.bernatchez.net/bucket/
dummy.bernatchez.net/bucket/*
##
## END additions for a new site
##
EOFGITIGNORE
cd ${HOME}/repos/mypelican_static_sites
git add .gitignore
Placer les fichiers personnalisables sous contrôle de version
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net
git add Makefile
git add deploy.bunny
git add favicon.ico
git add login.bunny
git add names.bunny
git add notes.txt
git add pelicanconf-en.py
git add pelicanconf-es.py
git add pelicanconf-fr.py
git add publishconf-en.py
git add publishconf-es.py
git add publishconf-fr.py
git add purge.bunny
git add puta2p.sh
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net/pages
git add *.rst
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net/content
git add binaries images sitepdfs
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net/pages-media
git add *
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net/pages-pdfs
git add placeholder.txt
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net/site-only-pdfs
git add placeholder.txt
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net/site-only
git add *.rst
# Valider vos ajouts git
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net/
git commit -m new-dummy-site
Générer cette première révision du site
cd ${HOME}/repos/mypelican_static_sites/dummy.bernatchez.net/
make html
# réviser et continuer la maintenance selon les besoins