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