-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathhtml_gen.py
More file actions
19 lines (19 loc) · 786 Bytes
/
html_gen.py
File metadata and controls
19 lines (19 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def posts_html(posts, channel):
html = ""
phtml = """<a href="/stream/{channel}/{id}"><div class="col">
<div class="card shadow-sm">
<img class="lzy_img" src="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/loading.gif" data-src="{img}" alt="{title}">
</img>
<div class="card-body">
<h6 class="card-subtitle">{title}</h5>
</div>
</div>
</div></a>"""
for post in posts:
html += phtml.format(
id=post["msg-id"],
img=f"/api/thumb/{channel}/{post['msg-id']}",
title=post["title"],
channel=channel,
)
return html