name_string = "</em>' '<em>".join(names)
content = f"<h1>Search '<em>{name_string}</em>'</h1><ul>"
- for file_name in listdir("./pages"):
- with open(f"./pages/{file_name}", "r") as f:
+ for file_name in listdir(f"{blog_path}/pages"):
+ with open(f"{blog_path}/pages/{file_name}", "r") as f:
s = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
for name in names:
i = s.find(str.encode(name))
if name == "all":
return redirect("/categories")
- for file_name in listdir("./pages"):
+ for file_name in listdir(f"{blog_path}/pages"):
keywords = ["Undefined"]
title = "Untitled post"
abstract = "..."
- with open(f"./pages/{file_name}", "r") as f:
+ with open(f"{blog_path}/pages/{file_name}", "r") as f:
while keywords == ["Undefined"]:
line = f.readline().split(":")
if len(line) == 2:
def generate_page(title):
title = title.replace("/", "")
try:
- with open(f"pages/{title}.md", "r") as f:
+ with open(f"{blog_path}/pages/{title}.md", "r") as f:
html = md.convert(f.read())
metadata = {k: v[0] for k, v in md.Meta.items()}
md.reset()