summaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-22 17:27:42 +0100
committerdavidovski <david@davidovski.xyz>2022-05-22 17:27:42 +0100
commit255ddf90edbb2d885ce159e2fdbb6f79f21c0b11 (patch)
tree562c6d0f30868554e3b1d205db6ab57d17022fe3 /build.py
parente80bb9d81583f01ea8c0a90dac5750c6992af0c4 (diff)
removed text from blog entries
Diffstat (limited to 'build.py')
-rw-r--r--build.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/build.py b/build.py
index d076ccd..a8bc85f 100644
--- a/build.py
+++ b/build.py
@@ -38,13 +38,14 @@ def listPages():
"source_file" : path,
"source_content" : content,
"html" : markdown.markdown("\n".join(content.split("\n...\n"))),
+ "title" : content.split("\n")[0].replace("# ", ""),
"summary" : lowerHeadings(markdown.markdown(content.split("\n...\n")[0])),
"timestamp" : timestamp,
"date": time.strftime(date_format, time.localtime(timestamp)),
"name" : name,
"url" : f"entries/{name}.html"
})(".".join(p.split(".")[:-1]))
- )(os.stat(path).st_ctime)
+ )(os.stat(path).st_mtime)
)(open(path, "r").read())
)(os.path.join(source, p)) for p in os.listdir(source)
]
@@ -92,7 +93,7 @@ def make():
.replace(
"%content%",
page["summary"] + (f"<a href={page['url']}>read more...</a>" if len(page["source_content"].split("\n...\n")) > 1 else "")
- )
+ ).replace("%title%", page["title"])
for page in pages
][: : -1]