From ee885d8af7eee45ca7bcbb554a25561041aa89de Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 1 Jun 2022 19:54:58 +0530 Subject: [PATCH] Fixed error in rebuildReferences() function that was generating a broken archive.gmi file. --- gempost | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gempost b/gempost index ffbc578..054b83d 100755 --- a/gempost +++ b/gempost @@ -94,8 +94,11 @@ def rebuildReferences(filename = None, title = None, callingFrom = "default"): headerText.append("\n## Older\n") # for older entries, refer to another file, archive.gmi, which is basically a reversed copy of {indexFile} to show the most recent posts on top + archiveLines = [] # archive.gmi needs just ./filenames instead of postdir/filenames + for i in allposts[::-1]: # storing a modified file list with just the filenames as links + archiveLines.append(f"=> ./{i[11:]}") with open(f"{postDir}archive.gmi","w") as ar: # creating all posts list - ar.writelines(allposts[::-1]) + ar.writelines(archiveLines) headerText.append(f"=> postdir/archive.gmi Posts Archive")