From 67c4b13b0ac4c97c0fea8db52a1be8a30c3c453a Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 2 Jun 2022 22:50:21 +0530 Subject: [PATCH] Fixed adding ASCII art when posting from .gmi file. --- gempost | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gempost b/gempost index 8a69827..8b96a7f 100755 --- a/gempost +++ b/gempost @@ -227,8 +227,14 @@ def newpost(title, existing_content = None): postHeader = "" if modified: # add content to file using the existing_content list instead of opening editor - with open(f"{wdir+filename}.gmi", 'w') as o: - o.writelines(existing_content) + if (ch != 'n' or ch != 'N'): + with open(f"{wdir}blogpostHeader.gmi") as a: # loading post header + postHeader = a.readlines() + with open(f"{wdir+filename}.gmi", 'w') as o: + o.writelines(postHeader + existing_content) + else: + with open(f"{wdir+filename}.gmi", 'w') as o: + o.writelines(existing_content) else: temp = "# " + title exec(f'echo "{temp}" | cat >> {wdir + filename}.gmi') # adding title to empty file