mirror of
https://git.ari.lt/ari.lt/ari.lt.git
synced 2025-02-04 17:49:24 +01:00
update @ Sat 23 Oct 01:45:39 EEST 2021
This commit is contained in:
parent
236f44482b
commit
d519538eae
1 changed files with 7 additions and 5 deletions
|
@ -5,7 +5,6 @@ import os, subprocess
|
||||||
import markdown
|
import markdown
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def main() -> int:
|
async def main() -> int:
|
||||||
open("/tmp/blog.md", "w").close()
|
open("/tmp/blog.md", "w").close()
|
||||||
|
|
||||||
|
@ -23,7 +22,7 @@ async def main() -> int:
|
||||||
with open("/tmp/blog.md", "r") as f:
|
with open("/tmp/blog.md", "r") as f:
|
||||||
blog_content = f.read()
|
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
|
content = f"""# %s
|
||||||
|
|
||||||
{date} | [back](..) | [home](/) | [git](//github.com/TruncatedDinosour/website)
|
{date} | [back](..) | [home](/) | [git](//github.com/TruncatedDinosour/website)
|
||||||
|
@ -38,7 +37,8 @@ async def main() -> int:
|
||||||
with open(
|
with open(
|
||||||
f"./page/blog/blogs/{blog_title.replace(' ', '-').replace('/', '_')}.html", "w"
|
f"./page/blog/blogs/{blog_title.replace(' ', '-').replace('/', '_')}.html", "w"
|
||||||
) as f:
|
) as f:
|
||||||
f.write(f"""<!DOCTYPE html>
|
f.write(
|
||||||
|
f"""<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
@ -55,11 +55,13 @@ async def main() -> int:
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</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:
|
with open("./page/blog/index.md", "a") as f:
|
||||||
f.write(
|
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:
|
with open("./page/blog/index.html", "w") as f:
|
||||||
|
|
Loading…
Add table
Reference in a new issue