Fixed error in rebuildReferences() function that was generating a broken archive.gmi file.
This commit is contained in:
parent
4eb2fe8dca
commit
ee885d8af7
5
gempost
5
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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue