From 5c7b3dac9dc1c10e549f7b01585b3ff0bdeb4385 Mon Sep 17 00:00:00 2001
From: Orestis <orestis.malaspinas@hesge.ch>
Date: Sat, 31 Oct 2020 23:40:21 +0100
Subject: [PATCH] adding last commit date for blog date...

---
 Makefile | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index e9d3f02..e31c6e7 100644
--- a/Makefile
+++ b/Makefile
@@ -30,29 +30,36 @@ cours.html: 00_macros.md 01_rappel.md 02_optimisation.md 03_integrales.md 04_edo
 
 hakyll_gen: 1_Rappel.markdown 2_Optimisation.markdown 3_Integrales.markdown 4_Equation_Differentielles_Ordinaires.markdown 5_Transformees_de_Fourier.markdown 6_Probabilites_et_Statistique.markdown 7_Remerciements.markdown
 
-macros: 00_macros.md
-	sed  "1i ---\ndate: $(shell date +%y%y-%m-%d)\n---" $< > $@
+# macros: 00_macros.md
+# 	sed  "1i ---\ndate: $(shell git log --follow -p -1 --format=%cd --date=format:'%Y-%m-%d' -- 02_optimisation.md | head -n 1)\n---" $< > $@
 
-1_Rappel.markdown: macros 01_rappel.md 08_notes.md
+1_Rappel.markdown: 00_macros.md 01_rappel.md 08_notes.md
 	cat $^ > $@
+	sed -i "1i ---\ndate: $(shell git log --follow -p -1 --format=%cd --date=format:'%Y-%m-%d' -- 01_rappel.md | head -n 1)\n---" $@
 
-2_Optimisation.markdown: macros 02_optimisation.md 08_notes.md
+2_Optimisation.markdown: 00_macros.md 02_optimisation.md 08_notes.md
 	cat $^ > $@
+	sed -i "1i ---\ndate: $(shell git log --follow -p -1 --format=%cd --date=format:'%Y-%m-%d' -- 02_optimisation.md | head -n 1)\n---" $@
 
-3_Integrales.markdown: macros 03_integrales.md 08_notes.md
+3_Integrales.markdown: 00_macros.md 03_integrales.md 08_notes.md
 	cat $^ > $@
+	sed -i "1i ---\ndate: $(shell git log --follow -p -1 --format=%cd --date=format:'%Y-%m-%d' -- 03_integrales.md | head -n 1)\n---" $@
 
-4_Equation_Differentielles_Ordinaires.markdown: macros 04_edo.md 08_notes.md
+4_Equation_Differentielles_Ordinaires.markdown: 00_macros.md 04_edo.md 08_notes.md
 	cat $^ > $@
+	sed -i "1i ---\ndate: $(shell git log --follow -p -1 --format=%cd --date=format:'%Y-%m-%d' -- 04_edo.md | head -n 1)\n---" $@
 
-5_Transformees_de_Fourier.markdown: macros 05_fourier.md 08_notes.md
+5_Transformees_de_Fourier.markdown: 00_macros.md 05_fourier.md 08_notes.md
 	cat $^ > $@
+	sed -i "1i ---\ndate: $(shell git log --follow -p -1 --format=%cd --date=format:'%Y-%m-%d' -- 05_fourier.md | head -n 1)\n---" $@
 
-6_Probabilites_et_Statistique.markdown: macros 06_probas_stats.md 08_notes.md
+6_Probabilites_et_Statistique.markdown: 00_macros.md 06_probas_stats.md 08_notes.md
 	cat $^ > $@
+	sed -i "1i ---\ndate: $(shell git log --follow -p -1 --format=%cd --date=format:'%Y-%m-%d' -- 06_probas_stats.md | head -n 1)\n---" $@
 
-7_Remerciements.markdown: macros 07_remerciements.md 08_notes.md
+7_Remerciements.markdown: 00_macros.md 07_remerciements.md 08_notes.md
 	cat $^ > $@
+	sed -i "1i ---\ndate: $(shell git log --follow -p -1 --format=%cd --date=format:'%Y-%m-%d' -- 07_remerciements.md | head -n 1)\n---" $@
 
 
 deploy: all
@@ -73,4 +80,4 @@ deploy: all
 	cp travaux_pratiques/tpOptimisation/tpOptimisation.html mti/tpOptimisation/index.html
 
 clean:
-	rm -rf mti *.markdown macros *.html *.pdf
+	rm -rf mti *.markdown *.html *.pdf
-- 
GitLab