diff --git a/.gitignore b/.gitignore index f187cdd..9304dc0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ porteail/* .gitignore -categories.html configrc diff --git a/GNUmakefile b/GNUmakefile index 81fdb4d..e231e65 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -35,45 +35,14 @@ include configrc ## AUTRES CONFIGS ##--[[ adresses ]]--## -INTRO_ADDR = $(COMPOSANTS)/$(INTRO) -INDEX_ADDR = $(CIBLE)/$(INDEX) -MENU_ADDR = $(COMPOSANTS)/$(MENU) -CSS_SANS_MENU_ADDR = $(CSS)/$(CSS_SANS_MENU) -CSS_AVEC_MENU_ADDR = $(CSS)/$(CSS_AVEC_MENU) -STYLE_ADDR = $(CSS)/$(STYLE) -ENTETE_ADDR = $(COMPOSANTS)/$(ENTETE) -ENQUEUE_ADDR = $(COMPOSANTS)/$(ENQUEUE) -POST_CONTENU_ADDR = $(COMPOSANTS)/$(POST_CONTENU) -ENTETE_CAT_ADDR = $(COMPOSANTS)/$(ENTETE_CAT) -ENQUEUE_CAT_ADDR = $(COMPOSANTS)/$(ENQUEUE_CAT) -ELEMENT_ADDR = $(COMPOSANTS)/$(ELEMENT) -CONTENU_ADDR = $(COMPOSANTS)/$(CONTENU) -DEFAUT_IMG_ADDR = $(IMAGES)/$(DEFAUT_IMG) - -##--[[ dépendances ]]--## -ifndef $(MENU) - CSS_DEP = $(CSS_SANS_MENU_ADDR) -else - CSS_DEP = $(CSS_AVEC_MENU_ADDR) -endif -INDEX_DEP = $(ENTETE_ADDR) $(ENQUEUE_ADDR) $(POST_CONTENU_ADDR) -CSS_TOUS = $(CIBLE)/$(STYLE) $(CIBLE)/$(CSS_NOM) -CONFIG = paconfigrc configrc - -# Éléments sources -SOURCE = $(CATEGORIES)/*.$(CATEGORIES_EXT) +INTRO_ADDR = $(COMPONENTS)/$(INTRO) +MENU_ADDR = $(COMPONENTS)/$(MENU) # programmes PROG_ECHO = `which echo` PROG_TEST = `which test` -PROG_SED = `which sed` -PROG_CAT = `which cat` -PROG_CP = `which cp` -PROG_SH = `which sh` PROG_RM = `which rm` -PROG_FIND = `which find` -PROG_SORT = `which sort` -PROG_WC = `which wc` +PROG_LUA = `which lua` PROG_MKDIR = `which mkdir` # vérification des programmes @@ -83,37 +52,19 @@ endif ifndef PROG_TEST error_test = 1 endif -ifndef PROG_SED -error_sed = 1 -endif -ifndef PROG_CAT -error_cat = 1 -endif -ifndef PROG_CP -error_cp = 1 -endif -ifndef PROG_SH -error_sh = 1 -endif ifndef PROG_RM error_rm = 1 endif -ifndef PROG_FIND -error_find = 1 -endif -ifndef PROG_SORT -error_sort = 1 -endif -ifndef PROG_WC -error_wc = 1 -endif ifndef PROG_MKDIR error_mkdir = 1 endif +ifndef PROG_LUA +error_lua = 1 +endif ## DEBUT # création de tous les fichiers -all: test index +all: test homepage ## TEST # divers tests sur l'existence des dossiers/fichiers @@ -131,13 +82,14 @@ test: $(if $(error_find), @$(PROG_ECHO) -e "\t\tfind : MANQUANT." ; exit 1) $(if $(error_sort), @$(PROG_ECHO) -e "\t\tsort : MANQUANT." ; exit 1) $(if $(error_wc), @$(PROG_ECHO) -e "\t\twc : MANQUANT." ; exit 1) + $(if $(error_lua), @$(PROG_ECHO) -e "\t\tlua : MANQUANT." ; exit 1) @$(PROG_ECHO) -e "\t…existence des dossiers '$(IMAGES)', '$(CATEGORIES)' et '$(CSS)'" @for i in $(IMAGES) $(CATEGORIES) $(CSS) ; \ do \ $(PROG_TEST) -d $$i || exit 1 ; \ done ; \ - $(PROG_ECHO) -e "\t…création des dossiers cibles '$(CIBLE)' et '$(CIBLE)/$(IMAGES_CIBLE)'" - @for j in $(CIBLE) $(CIBLE)/$(IMAGES_CIBLE) ; \ + $(PROG_ECHO) -e "\t…création des dossiers cibles '$(DESTINATION)' et '$(DESTINATION)/$(IMAGES_DESTINATION)'" + @for j in $(DESTINATION) $(DESTINATION)/$(IMAGES_DESTINATION) ; \ do \ $(PROG_TEST) -d $$j || $(PROG_MKDIR) $$j ; \ done @@ -149,82 +101,16 @@ test: $(if $(MENU), @$(PROG_ECHO) -e "\t\t-> activée", @$(PROG_ECHO) -e "\t\t-> désactivée") @$(PROG_ECHO) -e " …terminé." -## FICHIERS CSS -# création du fichier CSS -$(CIBLE)/$(CSS_NOM): $(CONFIG) $(CSS_DEP) - @$(PROG_ECHO) -e "Création du fichier CSS…" - $(if $(MENU), @$(PROG_CP) $(CSS_AVEC_MENU_ADDR) $(CIBLE)/$(CSS_NOM), @$(PROG_CP) $(CSS_SANS_MENU_ADDR) $(CIBLE)/$(CSS_NOM)) - @$(PROG_ECHO) -e " …terminée." - -# création du fichier CSS de couleur -$(CIBLE)/$(STYLE): $(CONFIG) $(STYLE_ADDR) - @$(PROG_ECHO) -e "Création du fichier CSS pour les couleurs…" - @$(PROG_CP) $(STYLE_ADDR) $(CIBLE)/$(STYLE) - @$(PROG_ECHO) -e " …terminée." - ## CATEGORIES -# création du fichier $(CONTENU_ADDR) -$(CONTENU_ADDR): $(CONFIG) $(GEN_CATEGORIES) $(SOURCE) $(DEFAUT_IMG_ADDR) - @$(PROG_SED) -i "s/DEBUG=1/DEBUG=0/g" $(GEN_CATEGORIES) - @$(PROG_ECHO) -e "Création du contenu avec les valeurs suivantes : " - @$(PROG_ECHO) -e "\t\t- Dossier catégorie : $(CATEGORIES)" - @$(PROG_ECHO) -e "\t\t- Destination temporaire du contenu : $(CONTENU_ADDR)" - @$(PROG_ECHO) -e "\t\t- Extension des fichiers à lire : $(CATEGORIES_EXT)" - @$(PROG_ECHO) -e "\t\t- Dossier ayant les composants de la page : $(COMPOSANTS)" - @$(PROG_ECHO) -e "\t\t- Entête HTML d'une catégorie : $(ENTETE_CAT_ADDR)" - @$(PROG_ECHO) -e "\t\t- Enqueue HTML d'une catégorie : $(ENQUEUE_ADDR)" - @$(PROG_ECHO) -e "\t\t- Code HTML d'un élément : $(ELEMENT_ADDR)" - @$(PROG_ECHO) -e "\t\t- Dossier contenant les images sources : $(IMAGES)" - @$(PROG_ECHO) -e "\t\t- Dossier de destination des images : $(IMAGES_CIBLE)" - @$(PROG_ECHO) -e "\t\t- Image par défaut : $(DEFAUT_IMG_ADDR)" - @$(PROG_ECHO) -e "\t\t- Dossier de destination global : $(CIBLE)" - @$(PROG_SH) $(GEN_CATEGORIES) $(CATEGORIES) $(CONTENU_ADDR) $(CATEGORIES_EXT) $(COMPOSANTS) $(ENTETE_CAT_ADDR) $(ENQUEUE_CAT_ADDR) $(ELEMENT_ADDR) $(IMAGES) $(IMAGES_CIBLE) $(DEFAUT_IMG_ADDR) $(CIBLE) - -## JAVASCRIPT -# création du fichier html5.js -html5.js: $(COMPOSANTS) - @$(PROG_ECHO) -e "Création du fichier html5.js…" - @$(PROG_CP) $(COMPOSANTS)/html5.js $(CIBLE)/html5.js - @$(PROG_ECHO) -e " …terminée." - -## INDEX -# création de la page d'index -index: $(CONFIG) $(INDEX_ADDR) $(CSS_TOUS) - -$(INDEX_ADDR): $(CONFIG) $(INDEX_DEP) $(CONTENU_ADDR) html5.js - @$(PROG_ECHO) -e "Création de la page de garde…" -# entete - @$(PROG_ECHO) -e "\t…insertion de l'entête" - @$(PROG_CAT) $(ENTETE_ADDR) > $(INDEX_ADDR) -# modification du contenu - @$(PROG_ECHO) -e "\t…modification du contenu" - @$(PROG_SED) -i \ - -e "s/@@TITRE_PORTEAIL@@/$(TITRE)/g" \ - -e "s/@@ACCUEIL_PORTEAIL@@/$(ACCUEIL)/g" \ - -e "s#@@CSS_DEFAUT@@#./$(CSS_NOM)#g" \ - -e "s#@@CSS_COULEUR@@#./$(STYLE)#g" \ - -e "s/^\(.*\)@@.*@@\(.*\)$$/\1\2/g" \ - $(INDEX_ADDR) - @$(PROG_ECHO) -e "\t …contenu modifié avec succès !" -# introduction (SI la variable INTRO est remplie) - $(if $(INTRO), @cat $(INTRO_ADDR) >> $(INDEX_ADDR); $(PROG_ECHO) -e "\t…insertion de l'introduction" || exit 1) -# contenu - @$(PROG_ECHO) -e "\t…insertion du contenu" - @$(PROG_CAT) $(CONTENU_ADDR) >> $(INDEX_ADDR) -# fin du contenu - @$(PROG_ECHO) -e "\t…insertion de la fin du contenu" - @$(PROG_CAT) $(POST_CONTENU_ADDR) >> $(INDEX_ADDR) -# menu - $(if $(MENU), @cat $(MENU_ADDR) >> $(INDEX_ADDR); $(PROG_ECHO) -e "\t…insertion du menu" || exit 1) -# enqueue - @$(PROG_ECHO) -e "\t…insertion de l'enqueue" - @$(PROG_CAT) $(ENQUEUE_ADDR) >> $(INDEX_ADDR) - @$(PROG_ECHO) -e " …terminée." +# création de la page d'accueil +homepage: + @$(PROG_ECHO) -e "Création de la page d'accueil…" + @$(PROG_LUA) create_homepage.lua || exit 1 + @$(PROG_ECHO) -e " …terminé." ## NETTOYAGE # nettoyage des fichiers générés clean: @$(PROG_ECHO) -e "Nettoyage des fichiers en cours…" - @$(PROG_RM) -rf $(CIBLE) - @$(PROG_RM) -f $(CONTENU_ADDR) + @$(PROG_RM) -rf $(DESTINATION) @$(PROG_ECHO) -e " …terminé." diff --git a/NEW_VARS.txt b/NEW_VARS.txt new file mode 100644 index 0000000..b7aba66 --- /dev/null +++ b/NEW_VARS.txt @@ -0,0 +1,25 @@ +# old one TITRE +TITLE = Titre par défaut +STYLE = noir.css +# old one CIBLE +DESTINATION = porteail +# old one ACCUEIL +HOMEPAGE = Accueil - $(TITRE) +GEN_CATEGORIES = creation_categ.sh +INDEX = index.html +CATEGORIES_EXT = txt +# old one DEFAUT_IMG +DEFAULT_IMG = generique.png +# old one ELEMENT +TEMPLATE_ELEMENT = element.html +# new one TEMPLATE_INDEX +TEMPLATE_INDEX = index.html +# new one TEMPLATE_CATEG +TEMPLATE_CATEG = categ.html +# old one COMPOSANTS +COMPONENTS = composants +CATEGORIES = categ +IMAGES = img +CSS = style +# old one CSS_NOM +CSS_NAME = defaut.css diff --git a/OLD_VARS.txt b/OLD_VARS.txt new file mode 100644 index 0000000..8ca416c --- /dev/null +++ b/OLD_VARS.txt @@ -0,0 +1,64 @@ +########################### +## Configuration basique ## +########################### + +# Titre de votre PorteAil +TITRE = Titre par défaut +# Feuille de style choisie +STYLE = noir.css +# Code HTML du menu (par défaut dans le dossier COMPOSANTS) +#MENU = menu.html +# Code HTML de l'introduction (par défaut dans le dossier COMPOSANTS) +#INTRO = introduction.html +CIBLE = porteail + +########################### +## Configuration avancée ## +########################### + +##--[[ divers ]]--## + +ACCUEIL = Accueil - $(TITRE) +GEN_CATEGORIES = creation_categ.sh +INDEX = index.html +# Extension des fichiers à prendre en compte dans le dossier contenant les +#+ catégories +CATEGORIES_EXT = txt +# Image de base si aucune mentionnée (par défaut dans le dossier IMAGES) +DEFAUT_IMG = generique.png +# Contenu HTML d'un élément +ELEMENT = element.html +# résultat de la génération des catégories +CONTENU = categories.html +# Contenu HTML à utiliser en début de catégorie +ENTETE_CAT = categ_deb.html +# Contenu HTML à utiliser en fin de catégorie +ENQUEUE_CAT = categ_fin.html +# Contenu HTML à utiliser après le contenu principal de la page +POST_CONTENU = contenu_fin.html +# Contenu HTML à utiliser en début de page finale +ENTETE = entete.html +# Contenu HTML à utiliser en fin de page finale +ENQUEUE = enqueue.html + +##--[[ dossiers ]]--## + +## SOURCES +# Dossier contenant les éléments composants votre page +COMPOSANTS = composants +# dossier contenant le détail des catégories +CATEGORIES = categ +# dossier contenant les images +IMAGES = img +# dossier contenant les feuilles de style +CSS = style + +## DESTINATION (cible) +# dossier de destination des images +IMAGES_CIBLE = image + +##--[[ style ]]--## + +CSS_SANS_MENU = sans_menu.css +CSS_AVEC_MENU = avec_menu.css +CSS_NOM = defaut.css diff --git a/composants/categ.html b/composants/categ.html deleted file mode 100644 index 703c10d..0000000 --- a/composants/categ.html +++ /dev/null @@ -1,8 +0,0 @@ - - -
${CATEG_DESC}
-@@DESC_CATEG@@
-${CATEG_DESC}
+