Compare commits
No commits in common. "cc7a7335042c9bcc4e96de7ba6e74a2e57a599bd" and "32b9b19604721c4db080de975f60c3cea10613f8" have entirely different histories.
cc7a733504
...
32b9b19604
|
@ -59,13 +59,13 @@ def findGemlogEntries(d: str) -> [LogEntry]:
|
|||
return entries
|
||||
|
||||
|
||||
def render_article(article_filename, dst):
|
||||
def render_article(article_filename, dst, hostname):
|
||||
'''
|
||||
Reading an article from the gemlog source, then rendering the same
|
||||
entry with the entry footer in the dst dir.
|
||||
'''
|
||||
with open(article_filename, 'r') as f:
|
||||
article = f.read() + entry_footer
|
||||
article = f.read() + entry_footer(hostname)
|
||||
dst_filename = os.path.join(dst, os.path.basename(article_filename))
|
||||
with open(dst_filename, 'w') as f:
|
||||
print(article, file=f)
|
||||
|
@ -85,7 +85,7 @@ if __name__ == '__main__':
|
|||
entries.sort(key=(lambda x:x.date), reverse=True)
|
||||
if not os.path.exists(dst_dir):
|
||||
os.mkdir(dst_dir)
|
||||
[render_article(a.path, dst_dir) for a in entries]
|
||||
[render_article(a.path, dst_dir, hostname) for a in entries]
|
||||
index = render_index(entries)
|
||||
with open(os.path.join(dst_dir, "index.gmi"), 'w') as f:
|
||||
print(index, file=f)
|
||||
|
|
Loading…
Reference in New Issue