corrige la génération de page catégorie

This commit is contained in:
Yannick Francois
2020-03-15 01:05:39 +01:00
parent 33d604b0f6
commit 02a4bdc640
11 changed files with 78 additions and 60 deletions
+33
View File
@@ -0,0 +1,33 @@
import os
keywords = "keywords.md"
with open(keywords) as f:
content = f.readlines()
content = [y for x in content for y in x.strip().split(':') ]
keyword = content[0]
directory = "content/" + content[0]
filename = content[1].replace("content", "")
htmlfilename = filename.replace(".md", ".html")
article = content[2]
if os.path.exists(directory + "/index.md"):
os.remove(directory + "/index.md")
if os.path.exists(directory + "/index.html"):
os.remove(directory + "/index.html")
if os.path.exists(directory):
os.rmdir(directory)
if not os.path.exists(directory):
os.makedirs(directory)
fileindex=directory + "/index.md"
with open(fileindex, 'a') as f:
if f.tell() == 0:
f.write('---\ntitle: ' + keyword.capitalize() + "\n---\n")
f.write("- [" + article + "](" + htmlfilename + ")\n")
fileindexhtml=directory + "/index.html"
os.system('pandoc --template=lib/template.html -c lib/pandoc.css ' + fileindex + ' -o ' + fileindexhtml)
-2
View File
@@ -1,2 +0,0 @@
- [accueil](/)
+1 -4
View File
@@ -1,10 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta name="generator" content="Hugo 0.22.1" />
<meta charset="utf-8"> <meta charset="utf-8">
<title>Yannick François - Elsif.fr</title> <title>Yannick François - Elsif.fr</title>
<meta name="DC.title" content="elsif.fr, site de Yannick François aka yaf (ou ya_f)."/> <meta name="DC.title" content="elsif.fr, site de Yannick François aka yaf (ou ya_f)."/>
<meta name="description" content="Le site de Yannick François. Développeur Senior, Responsable Produit, Pédagogue. Je travail chez Scopyleft"/> <meta name="description" content="Le site de Yannick François. Développeur Senior, Responsable Produit, Pédagogue. Je travail chez Scopyleft"/>
<meta name="keywords" content="code, développement, programmation, apprentissage, apprendre, lean, agile, logiciel, tdd, objet, refactoring, libre, creative commons, linux, unix"/> <meta name="keywords" content="code, développement, programmation, apprentissage, apprendre, lean, agile, logiciel, tdd, objet, refactoring, libre, creative commons, linux, unix"/>
@@ -22,8 +20,7 @@
</head> </head>
<body> <body>
<article> <article>
<h1>Boîte à idée</h1>
<h1 id="boîte-à-idée">Boîte à idée</h1>
<p><em>ou bien liste énorme de truc que jaimerais bien faire un jour</em></p> <p><em>ou bien liste énorme de truc que jaimerais bien faire un jour</em></p>
<ul> <ul>
<li>Acheter des bocaux pour faire de la fermentation de legumes</li> <li>Acheter des bocaux pour faire de la fermentation de legumes</li>
+3 -1
View File
@@ -1,4 +1,6 @@
# Boîte à idée ---
title: Boîte à idée
---
_ou bien liste énorme de truc que j'aimerais bien faire un jour_ _ou bien liste énorme de truc que j'aimerais bien faire un jour_
+11 -11
View File
@@ -5,62 +5,62 @@
<subtitle>les dernières mise à jour du site</subtitle> <subtitle>les dernières mise à jour du site</subtitle>
<link href="http://elsif.fr/" /> <link href="http://elsif.fr/" />
<id>tag:elsif.fr</id> <id>tag:elsif.fr</id>
<updated>Sun, 08 Mar 2020 01:05:24 +0100</updated> <updated>Sun, 15 Mar 2020 01:04:24 +0100</updated>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Notes du 5 Septembre 2018 Notes du 5 Septembre 2018
</title><link href='https://elsif.fr/posts/2018-09-05/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:e376070a1cc3fa1db6ad489da59ea6ffe9fd9a13</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> </title><link href='https://elsif.fr/posts/2018-09-05/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:e376070a1cc3fa1db6ad489da59ea6ffe9fd9a13</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Notes du 30 Août 2018 Notes du 30 Août 2018
</title><link href='https://elsif.fr/posts/2018-08-30/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:c7a2f02a9ed8b51ab587e0733574e272e689403b</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> </title><link href='https://elsif.fr/posts/2018-08-30/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:c7a2f02a9ed8b51ab587e0733574e272e689403b</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Notes du 29 Août 2018 Notes du 29 Août 2018
</title><link href='https://elsif.fr/posts/2018-08-29/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:1fec9381a7f949e01b145c8c06e121eeaf9cacf7</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> </title><link href='https://elsif.fr/posts/2018-08-29/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:1fec9381a7f949e01b145c8c06e121eeaf9cacf7</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Notes du 28 Août 2018 Notes du 28 Août 2018
</title><link href='https://elsif.fr/posts/2018-08-28/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:350b836d6d29d3f4aa8752c77a988ebc7e571ef2</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> </title><link href='https://elsif.fr/posts/2018-08-28/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:350b836d6d29d3f4aa8752c77a988ebc7e571ef2</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Notes du 27 Août 2018 Notes du 27 Août 2018
</title><link href='https://elsif.fr/posts/2018-08-27/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:2fe63134980573d4aa2abbfa3f7dc0be3dd3a0ad</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> </title><link href='https://elsif.fr/posts/2018-08-27/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:2fe63134980573d4aa2abbfa3f7dc0be3dd3a0ad</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Notes du 26 Août 2018 Notes du 26 Août 2018
</title><link href='https://elsif.fr/posts/2018-08-26/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:f4961e00db248c75dfb833871a9c0bedc4a1cc6f</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> </title><link href='https://elsif.fr/posts/2018-08-26/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,086939133+02:00</updated><id>tag:f4961e00db248c75dfb833871a9c0bedc4a1cc6f</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Notes du 23 Août 2018</title><link href='https://elsif.fr/posts/2018-08-23/index.html' rel='alternate' type='text/html'/><updated>2020-01-26T23:41:10,946346593+01:00</updated><id>tag:4da87e234b5f35ab3a06f939165cde91cb816148</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> Notes du 23 Août 2018</title><link href='https://elsif.fr/posts/2018-08-23/index.html' rel='alternate' type='text/html'/><updated>2020-01-26T23:41:10,946346593+01:00</updated><id>tag:4da87e234b5f35ab3a06f939165cde91cb816148</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Journal du 21 Août 2018 Journal du 21 Août 2018
</title><link href='https://elsif.fr/posts/2018-08-21/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,082939106+02:00</updated><id>tag:31a296556e0920cbb9c6913247a20fca60103f89</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> </title><link href='https://elsif.fr/posts/2018-08-21/index.html' rel='alternate' type='text/html'/><updated>2019-08-01T14:27:05,082939106+02:00</updated><id>tag:31a296556e0920cbb9c6913247a20fca60103f89</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a> <entry xml:lang='fr'><title><a class="top header-title" href="../../index.html">Les pieds dans le code</a>
Journal du 17 Août 2018</title><link href='https://elsif.fr/posts/2018-08-17/index.html' rel='alternate' type='text/html'/><updated>2020-01-27T21:46:22,295795901+01:00</updated><id>tag:a1493b8b98581807dcb4218e4424b8013b178beb</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> Journal du 17 Août 2018</title><link href='https://elsif.fr/posts/2018-08-17/index.html' rel='alternate' type='text/html'/><updated>2020-01-27T21:46:22,295795901+01:00</updated><id>tag:a1493b8b98581807dcb4218e4424b8013b178beb</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title>Les pieds dans le code <entry xml:lang='fr'><title>Les pieds dans le code
Journal du 16 August 2018 </title><link href='https://elsif.fr/posts/2018-08-16/index.html' rel='alternate' type='text/html'/><updated>2020-02-07T12:41:07,570788396+01:00</updated><id>tag:848181efb69f9596d8d39d0e2be2450db2ea45de</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> Journal du 16 August 2018 </title><link href='https://elsif.fr/posts/2018-08-16/index.html' rel='alternate' type='text/html'/><updated>2020-02-07T12:41:07,570788396+01:00</updated><id>tag:848181efb69f9596d8d39d0e2be2450db2ea45de</id><summary type='HTML'></summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
-2
View File
@@ -1,2 +0,0 @@
- [OpenBSD](/)
@@ -1,10 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta name="generator" content="Hugo 0.22.1" />
<meta charset="utf-8"> <meta charset="utf-8">
<title>Yannick François - Elsif.fr</title> <title>Yannick François - Elsif.fr</title>
<meta name="DC.title" content="elsif.fr, site de Yannick François aka yaf (ou ya_f)."/> <meta name="DC.title" content="elsif.fr, site de Yannick François aka yaf (ou ya_f)."/>
<meta name="description" content="Le site de Yannick François. Développeur Senior, Responsable Produit, Pédagogue. Je travail chez Scopyleft"/> <meta name="description" content="Le site de Yannick François. Développeur Senior, Responsable Produit, Pédagogue. Je travail chez Scopyleft"/>
<meta name="keywords" content="code, développement, programmation, apprentissage, apprendre, lean, agile, logiciel, tdd, objet, refactoring, libre, creative commons, linux, unix"/> <meta name="keywords" content="code, développement, programmation, apprentissage, apprendre, lean, agile, logiciel, tdd, objet, refactoring, libre, creative commons, linux, unix"/>
@@ -1,10 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta name="generator" content="Hugo 0.22.1" />
<meta charset="utf-8"> <meta charset="utf-8">
<title>Yannick François - Elsif.fr</title> <title>Yannick François - Elsif.fr</title>
<meta name="DC.title" content="elsif.fr, site de Yannick François aka yaf (ou ya_f)."/> <meta name="DC.title" content="elsif.fr, site de Yannick François aka yaf (ou ya_f)."/>
<meta name="description" content="Le site de Yannick François. Développeur Senior, Responsable Produit, Pédagogue. Je travail chez Scopyleft"/> <meta name="description" content="Le site de Yannick François. Développeur Senior, Responsable Produit, Pédagogue. Je travail chez Scopyleft"/>
<meta name="keywords" content="code, développement, programmation, apprentissage, apprendre, lean, agile, logiciel, tdd, objet, refactoring, libre, creative commons, linux, unix"/> <meta name="keywords" content="code, développement, programmation, apprentissage, apprendre, lean, agile, logiciel, tdd, objet, refactoring, libre, creative commons, linux, unix"/>
@@ -22,9 +20,9 @@
</head> </head>
<body> <body>
<article> <article>
<h1>Ruby</h1>
<ul> <ul>
<li><a href="/">OpenBSD</a></li> <li><a href="/posts/2009/2009-01-10-ruby-et-les-frameworks-web.html">Ruby et les frameworks web</a></li>
</ul> </ul>
</article> </article>
<footer> <footer>
+4
View File
@@ -0,0 +1,4 @@
---
title: Ruby
---
- [Ruby et les frameworks web](/posts/2009/2009-01-10-ruby-et-les-frameworks-web.html)
-2
View File
@@ -1,10 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta name="generator" content="Hugo 0.22.1" />
<meta charset="utf-8"> <meta charset="utf-8">
<title>Yannick François - Elsif.fr</title> <title>Yannick François - Elsif.fr</title>
<meta name="DC.title" content="elsif.fr, site de Yannick François aka yaf (ou ya_f)."/> <meta name="DC.title" content="elsif.fr, site de Yannick François aka yaf (ou ya_f)."/>
<meta name="description" content="Le site de Yannick François. Développeur Senior, Responsable Produit, Pédagogue. Je travail chez Scopyleft"/> <meta name="description" content="Le site de Yannick François. Développeur Senior, Responsable Produit, Pédagogue. Je travail chez Scopyleft"/>
<meta name="keywords" content="code, développement, programmation, apprentissage, apprendre, lean, agile, logiciel, tdd, objet, refactoring, libre, creative commons, linux, unix"/> <meta name="keywords" content="code, développement, programmation, apprentissage, apprendre, lean, agile, logiciel, tdd, objet, refactoring, libre, creative commons, linux, unix"/>
+14 -22
View File
@@ -10,7 +10,10 @@ KEYWORDS=keywords.md
cat "" > $KEYWORDS cat "" > $KEYWORDS
echo "## Generate HTML files for each markdown files"
for mdfile in $MARKDOWN_FILES; do for mdfile in $MARKDOWN_FILES; do
echo "-------------- current file $mdfile"
htmlfile="${mdfile%%.*}.html" htmlfile="${mdfile%%.*}.html"
if [ ! -f "$htmlfile" ] || [ "$htmlfile" -ot "$mdfile" ]; then if [ ! -f "$htmlfile" ] || [ "$htmlfile" -ot "$mdfile" ]; then
echo "--> generate with pandoc '$htmlfile' from '$mdfile'" echo "--> generate with pandoc '$htmlfile' from '$mdfile'"
@@ -19,28 +22,17 @@ for mdfile in $MARKDOWN_FILES; do
pandoc --template=lib/extract-keywords.md "$mdfile" >> $KEYWORDS pandoc --template=lib/extract-keywords.md "$mdfile" >> $KEYWORDS
done done
for line in $(cat $KEYWORDS); do echo "## END"
directory=content/$(echo $line | awk -F":" '{print $1}')
echo $directory
fichier=/$(echo $line | awk -F":" '{print $2}' | awk -F"content|index.md" '{print $1}')
echo $fichier
titre=$(echo $line | awk -F":" '{print $3}')
echo $titre
if [ ! -d $directory ]; then
mkdir -p $directory
fi
if [ ! -f $directory/index.md ]; then
touch $directory/index.md
else
echo "" > $directory/index.md
fi
echo "- [$titre]($fichier)" >> $directory/index.md echo "## Build keywords pages"
python build_theme_index.py
if [ ! -f "$htmlfile" ] || [ "$htmlfile" -ot "$mdfile" ]; then
echo "--> generate with pandoc '$htmlfile' from '$mdfile'"
pandoc --template=lib/template.html -c lib/pandoc.css "$mdfile" -o "$htmlfile"
fi
echo "## END"
pandoc --template=lib/template.html -c lib/pandoc.css "$directory/index.md" -o "$directory/index.html" echo "## Build atom"
done
echo "Build atom"
LAST_CHANGES=$(git log --pretty="format:" --name-only | grep "content/posts/20*" | grep ".html" | uniq | tac | head -10) LAST_CHANGES=$(git log --pretty="format:" --name-only | grep "content/posts/20*" | grep ".html" | uniq | tac | head -10)
echo "liste des 10 derniers fichiers qui ont changés : $LAST_CHANGES" echo "liste des 10 derniers fichiers qui ont changés : $LAST_CHANGES"
@@ -56,9 +48,9 @@ do
summary="" summary=""
ITEMS="$ITEMS ITEMS="$ITEMS
<entry xml:lang='fr'><title>$titre</title><link href='$lien' rel='alternate' type='text/html'/><updated>$updated</updated><id>tag:$(shasum $change | awk -F ' ' '{print $1}')</id><summary type='HTML'>$summary</summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry> <entry xml:lang='fr'><title>$titre</title><link href='$lien' rel='alternate' type='text/html'/><updated>$updated</updated><id>tag:$(shasum $change | awk -F ' ' '{print $1}')</id><summary type='HTML'>$summary</summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
" "
done done