mjestecko/tools/page_shares.py

67 lines
1.2 KiB
Python
Raw Normal View History

HEAD_EMBED = """
2023-05-26 09:00:48 +00:00
<div class="container">
2024-02-10 15:48:22 +00:00
<nav class="custom-nav">
2024-02-10 15:09:30 +00:00
<ul>
<li><a href="/"><strong>mjestečko</strong></a></li>
<li><a href="https://git.poto.cafe/veclavtalica/mjestecko">source</a></li>
<li><a href="/feed.xml">rss</a></li>
<li><a href="/articles/mjestečko.html">about</a></li>
2024-02-10 16:05:19 +00:00
<li><a href="https://modarchive.org/index.php?request=view_artist_modules&query=96070">tracks</a></li>
2024-02-11 15:49:27 +00:00
<li><a rel="me" href="https://poto.cafe/@veclavtalica">mastodon</a></li>
2024-02-16 13:29:50 +00:00
<li><a href="/tags.html">tags</a></li>
</ul>
2023-05-26 09:00:48 +00:00
</nav>
2023-05-26 09:00:48 +00:00
"""
2023-05-26 09:00:48 +00:00
NOTICE = """
2024-02-10 15:20:54 +00:00
<footer>
2024-02-16 12:10:59 +00:00
<a href="#top">^ Return</a>
2024-02-10 15:20:54 +00:00
</footer>
2024-02-10 15:48:22 +00:00
"""
TAIL_EMBED = """
</div>
"""
2023-05-22 11:21:00 +00:00
ADJECTIVES = ["*wild*", "**wacky**", "very humble", "**most serious**"]
MONTHS = {
1: "January",
2: "February",
3: "March",
4: "April",
5: "May",
6: "June",
7: "July",
8: "August",
9: "September",
10: "October",
11: "November",
12: "December"
}
WEEKDAYS = {
0: "Monday",
1: "Tuesday",
2: "Wednesday",
3: "Thursday",
4: "Friday",
5: "Saturday",
6: "Sunday"
}
2024-02-10 15:48:22 +00:00
def mixin_tag(content: str, tag: str) -> str:
return f"""<{tag}>
{content}</{tag}>
"""
def wrap_page(page: str) -> str:
2024-02-10 15:48:22 +00:00
return HEAD_EMBED + mixin_tag(page, "main") + NOTICE + TAIL_EMBED