blog #1

Merged
n merged 5 commits from blog into master 2021-03-08 23:23:01 +01:00
Showing only changes of commit 753cdc5ce3 - Show all commits

View file

@ -51,13 +51,14 @@ for x in myresult:
except OSError: except OSError:
print ("Creation of the directory %s failed" % path) print ("Creation of the directory %s failed" % path)
print("creating %s/%s.gmi" % (path,quote(filename))) if not os.path.isfile('%s/%s.gmi' % (path,quote(filename))):
f = open("%s/%s.gmi" % (path,quote(filename)), "w") print("creating %s/%s.gmi" % (path,quote(filename)))
f.write("# %s\n\n" % x[1]) f = open("%s/%s.gmi" % (path,quote(filename)), "w")
f.write("Publié le %s\n\n" % path) f.write("# %s\n\n" % x[1])
f.write(html2markdown.convert(x[2])) f.write("Publié le %s\n\n" % path)
f.write("\n\n=> /blog/ Retour au menu du blog") f.write(html2markdown.convert(x[2]))
f.close() f.write("\n\n=> /blog/ Retour au menu du blog")
f.close()
f = open("index.gmi", "a") f = open("index.gmi", "a")
f.write("\n=> Retour") f.write("\n=> Retour")