-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtemplates.py
81 lines (58 loc) · 1.65 KB
/
templates.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import string
index_html = string.Template(r"""<!DOCTYPE html>
<html lang="de">
<head>
<title>$podcast_title</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="stylesheet" type="text/css" href="cccp.css" />
<link rel="stylesheet" type="text/css" href="yaspp.css" />
<script src="https://cdn.podlove.org/web-player/embed.js"></script>
</head>
<body>
<header>
<div class="container introcontainer">
<h1 id="toc_0">$podcast_title</h1>
<div class="introblock">
$hello_text
</div>
<div class="buttonblock">
$subscribe_button
</div>
</div>
</header>
<div class=container>
<section id="main_content">
$content
</section>
</div>
<h2></h2>
<footer>
<center>
<small>
$footer_text
</small>
</center>
</footer>
</body>
</html>""")
entry = string.Template(r"""
<div id="$entrydivid" class="yaspp-entry">
<a href="#$uuid" style="text-decoration: none;"><h2 id="$uuid">$title</h2></a>
<p>$summary</p>
<div id="player_$entrydivid"></div>
<div id="shownotes_$entrydivid" class="yaspp-shownotes">
$long_summary
</div>
</div>
""")
subscribe_button = string.Template(r"""
<script>window.podcastData={
"title": "$title",
"subtitle": "",
"description": $description,
"cover": "$cover",
"feeds": [{"type":"audio","format":"mp3","url":"$feed_url"}]}
</script>
<script class="podlove-subscribe-button" src="https://cdn.podlove.org/subscribe-button/javascripts/app.js" data-language="en" data-size="medium" data-json-data="podcastData" data-color="$datacolor" data-format="cover" data-style="filled"></script><noscript><a href="$feed_url">Subscribe to feed</a></noscript>
""")