From 02a4bdc6408dfcc16b6b975716208d68cd4347dc Mon Sep 17 00:00:00 2001 From: Yannick Francois Date: Sun, 15 Mar 2020 01:05:39 +0100 Subject: [PATCH] =?UTF-8?q?corrige=20la=20g=C3=A9n=C3=A9ration=20de=20page?= =?UTF-8?q?=20cat=C3=A9gorie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build_theme_index.py | 33 +++++++++++++++ content/bidules/index.md | 2 - content/boite-a-idee/index.html | 5 +-- content/boite-a-idee/index.md | 4 +- content/feed.xml | 42 +++++++++---------- content/openbsd/index.md | 2 - ...2009-01-10-ruby-et-les-frameworks-web.html | 2 - content/{openbsd => ruby}/index.html | 6 +-- content/ruby/index.md | 4 ++ lib/template.html | 2 - pana.sh | 36 +++++++--------- 11 files changed, 78 insertions(+), 60 deletions(-) create mode 100644 build_theme_index.py delete mode 100644 content/bidules/index.md delete mode 100644 content/openbsd/index.md rename content/{openbsd => ruby}/index.html (91%) create mode 100644 content/ruby/index.md diff --git a/build_theme_index.py b/build_theme_index.py new file mode 100644 index 0000000..e5a067d --- /dev/null +++ b/build_theme_index.py @@ -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) + diff --git a/content/bidules/index.md b/content/bidules/index.md deleted file mode 100644 index c9973b1..0000000 --- a/content/bidules/index.md +++ /dev/null @@ -1,2 +0,0 @@ - -- [accueil](/) diff --git a/content/boite-a-idee/index.html b/content/boite-a-idee/index.html index 8ce4526..f709eb0 100644 --- a/content/boite-a-idee/index.html +++ b/content/boite-a-idee/index.html @@ -1,10 +1,8 @@ - Yannick François - Elsif.fr - @@ -22,8 +20,7 @@
- -

Boîte à idée

+

Boîte à idée

ou bien liste énorme de truc que j’aimerais bien faire un jour