added johnvertisement

This commit is contained in:
TriMill 2022-08-04 13:21:39 -04:00
parent 52369e77b1
commit 6d08c5bf79
2 changed files with 24 additions and 12 deletions

View file

@ -62,6 +62,7 @@ def index_blog(app):
blogposts = []
blog_dir = os.path.join(app.root_path, "blog")
for file in os.listdir(blog_dir):
try:
with open(os.path.join(blog_dir, file)) as f:
contents = f.read()
html = markdown2.markdown(contents, extras=markdown_extras)
@ -74,6 +75,8 @@ def index_blog(app):
meta["n"] = int(date_parts[3])
meta["url"] = f"/blog/{date.isoformat().replace('-','/')}/{meta['n']}"
blogposts.append(meta)
except Exception as e:
print("Error indexing blog post %s: %s" % (file, e))
return sorted(blogposts, key=lambda post:[post["date"], post["n"]], reverse=True)
def create_app():

View file

@ -48,4 +48,13 @@ It is built using the <a href="https://flask.palletsprojects.com/en/2.1.x/">Flas
icons from <a href="https://useiconic.com/open">Open Iconic</a>.
</p>
<br />
<div style="color: var(--fg-faded); text-align: center;">johnvertisement</div>
<p>
<iframe src="https://john.citrons.xyz/embed?ref=trimill.xyz" style="margin-left:auto;display:block;margin-right:auto;max-width:732px;width:100%;height:94px;border:none;"></iframe>
</p>
<br />
{% endblock %}