Fixed error in rebuildReferences() function that was generating a broken archive.gmi file.

This commit is contained in:
= 2022-06-01 19:54:58 +05:30
parent 4eb2fe8dca
commit ee885d8af7
1 changed files with 4 additions and 1 deletions

View File

@ -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")