Browse Source

:wrench: Differentiate content date and update date

- content date : date of the presented content
- update date : date of the last update of the source page
DricomDragon 1 year ago
parent
commit
500507f1d0

+ 4 - 3
makefile

@@ -27,6 +27,7 @@ LIST_GEN := yq eval-all '{"data": ., "target": {"content": filename | sub("meta.
 
 
 # Functions
 # Functions
 extract_category = $(word 2, $(subst /, ,$(1)))
 extract_category = $(word 2, $(subst /, ,$(1)))
+extract_update_date = $(shell git log -1 --pretty="format:%cs" $(1))
 
 
 # Build
 # Build
 .PHONY: build
 .PHONY: build
@@ -34,17 +35,17 @@ build: $(GEN_CONTENT_FILES)
 	$(info HTML generated)
 	$(info HTML generated)
 
 
 %.gen.html: %.src.html %.meta.yml $(SRC_TEMPLATES)
 %.gen.html: %.src.html %.meta.yml $(SRC_TEMPLATES)
-	$(PANDOC_GEN) --metadata-file $*.meta.yml --metadata=category-$(call extract_category,$*) --output $@ $<
+	$(PANDOC_GEN) --metadata-file $*.meta.yml --metadata=category-$(call extract_category,$*) --metadata=update-date:$(call extract_update_date,$<) --output $@ $<
 
 
 %.gen.html: %.src.md %.meta.yml $(SRC_TEMPLATES)
 %.gen.html: %.src.md %.meta.yml $(SRC_TEMPLATES)
-	$(PANDOC_GEN) --metadata-file $*.meta.yml --metadata=category-$(call extract_category,$*) --output $@ $<
+	$(PANDOC_GEN) --metadata-file $*.meta.yml --metadata=category-$(call extract_category,$*) --metadata=update-date:$(call extract_update_date,$<) --output $@ $<
 
 
 # Build lists
 # Build lists
 $(GEN_LIST_YML): $(SRC_LIST_YML)
 $(GEN_LIST_YML): $(SRC_LIST_YML)
 	$(LIST_GEN) $(SRC_LIST_YML) > $@
 	$(LIST_GEN) $(SRC_LIST_YML) > $@
 
 
 $(DIR_OF_PROJECTS)/content.gen.html: $(DIR_OF_PROJECTS)/content.src.html $(DIR_OF_PROJECTS)/content.meta.yml $(GEN_LIST_YML) $(SRC_TEMPLATES)
 $(DIR_OF_PROJECTS)/content.gen.html: $(DIR_OF_PROJECTS)/content.src.html $(DIR_OF_PROJECTS)/content.meta.yml $(GEN_LIST_YML) $(SRC_TEMPLATES)
-	$(PANDOC_GEN) --metadata-file $(DIR_OF_PROJECTS)/content.meta.yml --metadata-file $(GEN_LIST_YML) --metadata=category-projets --output $@ $<
+	$(PANDOC_GEN) --metadata-file $(DIR_OF_PROJECTS)/content.meta.yml --metadata-file $(GEN_LIST_YML) --metadata=category-projets --metadata=update-date:$(call extract_update_date,$<) --output $@ $<
 
 
 # Distribution
 # Distribution
 .PHONY: dist
 .PHONY: dist

+ 0 - 1
src/contact/content.meta.yml

@@ -5,7 +5,6 @@ img:
                 path: "/include/icon/icons8-96-filled-message.png"
                 path: "/include/icon/icons8-96-filled-message.png"
                 alt: "envelope flat icon"
                 alt: "envelope flat icon"
 subtitle: Retrouvez ici différents moyens pour me contacter
 subtitle: Retrouvez ici différents moyens pour me contacter
-date: 2018-12-20
 content-description:
 content-description:
         Pour l'instant par Linkedin, bientôt avec une adresse mail personnalisée.
         Pour l'instant par Linkedin, bientôt avec une adresse mail personnalisée.
 ...
 ...

+ 0 - 1
src/credit/content.meta.yml

@@ -4,7 +4,6 @@ img:
         icon:
         icon:
                 path: "/include/icon/iconmonstr-72-copyright-2.png"
                 path: "/include/icon/iconmonstr-72-copyright-2.png"
                 alt: "copyright flat icon"
                 alt: "copyright flat icon"
-date: 2023-05-20
 content-description:
 content-description:
         Cette page rassemble les ressources externes utilisées sur ce site.
         Cette page rassemble les ressources externes utilisées sur ce site.
 ...
 ...

+ 1 - 1
src/cv/content.meta.yml

@@ -5,5 +5,5 @@ img:
                 path: "/include/icon/icons8-96-parse-from-clipboard.png"
                 path: "/include/icon/icons8-96-parse-from-clipboard.png"
                 alt: "cv flat icon"
                 alt: "cv flat icon"
 subtitle: Ingénieur développement logiciel
 subtitle: Ingénieur développement logiciel
-date: 2023-05-15
+content-date: 2023-05-15
 ...
 ...

+ 0 - 1
src/error404/content.meta.yml

@@ -5,7 +5,6 @@ img:
                 path: "/include/icon/icons8-96-matrix-desktop.png"
                 path: "/include/icon/icons8-96-matrix-desktop.png"
                 alt: "matrix reloaded flat icon"
                 alt: "matrix reloaded flat icon"
 subtitle: Page non trouvée
 subtitle: Page non trouvée
-date: 2018-12-20
 content-description:
 content-description:
         La page à laquelle votre navigateur souhaite accéder n'existe pas.
         La page à laquelle votre navigateur souhaite accéder n'existe pas.
 ...
 ...

+ 0 - 1
src/index.meta.yml

@@ -8,7 +8,6 @@ img:
                 path: "/include/icon/icons8-96-city.png"
                 path: "/include/icon/icons8-96-city.png"
                 alt: "sympathic city flat icon"
                 alt: "sympathic city flat icon"
 subtitle: "Bienvenue sur mon site !"
 subtitle: "Bienvenue sur mon site !"
-date: 2018-12-20
 content-description: "
 content-description: "
         Vous trouverez ici les principales informations me concernant :
         Vous trouverez ici les principales informations me concernant :
         qui je suis, mon parcours, mon expérience professionnelle 
         qui je suis, mon parcours, mon expérience professionnelle 

+ 1 - 1
src/projets/ascii_space/content.meta.yml

@@ -8,7 +8,7 @@ img:
                 path: "project_icon_ASCII.png"
                 path: "project_icon_ASCII.png"
                 alt: "Icon featuring three starships of ASCII Space Destroyer"
                 alt: "Icon featuring three starships of ASCII Space Destroyer"
 subtitle: Jeu vidéo réalisé en C++
 subtitle: Jeu vidéo réalisé en C++
-date: 2015-08-15
+content-date: 2015-08-15
 content-description:
 content-description:
         Derrière ce nom un peu bourrin se cache un shooter à la <em>Space Invader</em>
         Derrière ce nom un peu bourrin se cache un shooter à la <em>Space Invader</em>
         où les joueurs peuvent concevoir leur propre vaisseau
         où les joueurs peuvent concevoir leur propre vaisseau

+ 0 - 1
src/projets/content.meta.yml

@@ -5,7 +5,6 @@ img:
                 path: "/include/icon/icons8-96-code.png"
                 path: "/include/icon/icons8-96-code.png"
                 alt: "code flat icon"
                 alt: "code flat icon"
 subtitle: Mon folio de développeur
 subtitle: Mon folio de développeur
-date: 2023-05-20
 content-description:
 content-description:
         Voici l'ensemble des projets de programmation auxquels j'ai participé.
         Voici l'ensemble des projets de programmation auxquels j'ai participé.
         Certains ont été faits en équipe,
         Certains ont été faits en équipe,

+ 1 - 1
src/projets/pulsar/content.meta.yml

@@ -8,7 +8,7 @@ img:
                 path: "icons8-48-uranus-planet.png"
                 path: "icons8-48-uranus-planet.png"
                 alt: "Uranus planet icon"
                 alt: "Uranus planet icon"
 subtitle: Concept de jeu vidéo
 subtitle: Concept de jeu vidéo
-date: 2017-03-20
+content-date: 2017-03-20
 content-description:
 content-description:
         Pulsar est un grand projet qui est dans mon tiroir depuis 3 ans.
         Pulsar est un grand projet qui est dans mon tiroir depuis 3 ans.
         Il est ambitieux mais reste réalisable.
         Il est ambitieux mais reste réalisable.

+ 1 - 1
src/projets/quoridor/content.meta.yml

@@ -8,7 +8,7 @@ img:
                 path: "quoridor_400x400.png"
                 path: "quoridor_400x400.png"
                 alt: "Quoridor preview"
                 alt: "Quoridor preview"
 subtitle: TIPE 2017
 subtitle: TIPE 2017
-date: 2017-07-12
+content-date: 2017-07-12
 content-description:
 content-description:
         Développement d'intelligences artificielles pour le jeu de stratégie Quoridor.
         Développement d'intelligences artificielles pour le jeu de stratégie Quoridor.
         Ce projet est un travail de groupe réalisé sur l'ensemble de ma seconde année de prépa.
         Ce projet est un travail de groupe réalisé sur l'ensemble de ma seconde année de prépa.

+ 1 - 1
src/projets/static_site/content.meta.yml

@@ -8,7 +8,7 @@ img:
                 path: "icons8-400-city.png"
                 path: "icons8-400-city.png"
                 alt: "Bright city with a tree"
                 alt: "Bright city with a tree"
 subtitle: Le site sur lequel vous surfez actuellement.
 subtitle: Le site sur lequel vous surfez actuellement.
-date: 2018-12-20
+content-date: 2018-12-20
 content-description:
 content-description:
         Article rédigé en décembre 2018 racontant la genèse et les coulisses de ce site web.
         Article rédigé en décembre 2018 racontant la genèse et les coulisses de ce site web.
 ...
 ...

+ 4 - 2
src/templates/footer.html

@@ -3,9 +3,11 @@
         <span class="text-muted">
         <span class="text-muted">
             Version
             Version
             $version$
             $version$
+            mise en ligne le
+            $build-date$
             -
             -
-            Mise en ligne le
+            Page créée le $create-date$
-            $date-meta$
+            et dernièrement mise à jour le $update-date$
             -
             -
             <a href="/credit/content.html">
             <a href="/credit/content.html">
             Credits
             Credits

+ 6 - 4
src/templates/main.html

@@ -8,8 +8,10 @@
 $for(author-meta)$
 $for(author-meta)$
         <meta name="author" content="$author-meta$" />
         <meta name="author" content="$author-meta$" />
 $endfor$
 $endfor$
-$if(date-meta)$
+$if(content-date)$
-        <meta name="dcterms.date" content="$date-meta$" />
+        <meta name="dcterms.date" content="$content-date$" />
+$elseif(update-date)$
+        <meta name="dcterms.date" content="$update-date$" />
 $endif$
 $endif$
 $if(keywords)$
 $if(keywords)$
         <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
         <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
@@ -102,8 +104,8 @@ $endif$
 $for(author)$
 $for(author)$
                 <p class="author">$author$</p>
                 <p class="author">$author$</p>
 $endfor$
 $endfor$
-$if(date)$
+$if(content-date)$
-                <p class="date">$date$</p>
+                <p class="date" title="Date du contenu présenté">$content-date$</p>
 $endif$
 $endif$
 $if(content-description)$
 $if(content-description)$
                 <p class="lead">$content-description$</p>
                 <p class="lead">$content-description$</p>