update @ Sat 23 Oct 01:45:39 EEST 2021

This commit is contained in:
Ari Archer 2021-10-23 01:45:39 +03:00
parent 236f44482b
commit d519538eae

View file

@ -5,7 +5,6 @@ import os, subprocess
import markdown
async def main() -> int:
open("/tmp/blog.md", "w").close()
@ -23,7 +22,7 @@ async def main() -> int:
with open("/tmp/blog.md", "r") as f:
blog_content = f.read()
date = subprocess.check_output(['date', '+%F %T %Z']).decode().rstrip("\n")
date = subprocess.check_output(["date", "+%F %T %Z"]).decode().rstrip("\n")
content = f"""# %s
{date} | [back](..) | [home](/) | [git](//github.com/TruncatedDinosour/website)
@ -38,7 +37,8 @@ async def main() -> int:
with open(
f"./page/blog/blogs/{blog_title.replace(' ', '-').replace('/', '_')}.html", "w"
) as f:
f.write(f"""<!DOCTYPE html>
f.write(
f"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
@ -55,11 +55,13 @@ async def main() -> int:
</div>
</body>
</html>
<!-- this is automatically generated by scripts/add_blog -->""" % (blog_title, markdown.markdown(content)))
<!-- this is automatically generated by scripts/add_blog -->"""
% (blog_title, markdown.markdown(content))
)
with open("./page/blog/index.md", "a") as f:
f.write(
f"\n* [{blog_title}](/page/blog/blogs/{blog_title.replace(' ', '-').replace('/', '_').replace('"', "'")}.html)"
f"\n* [{blog_title}](/page/blog/blogs/{blog_title.replace(' ', '-').replace('/', '_')}.html)"
)
with open("./page/blog/index.html", "w") as f: