Skip to content

Commit 559a027

Browse files
committed
Add Zeabur affliation button
1 parent 07e0ec6 commit 559a027

File tree

3 files changed

+62
-37
lines changed

3 files changed

+62
-37
lines changed

app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
@app.errorhandler(404)
19-
def page_not_found(e):
19+
def page_not_found(err):
2020
return redirect("/")
2121

2222

templates/base.html

+39-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,65 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en" data-theme="light">
33
<head>
4-
<meta charset="UTF-8">
5-
{% set description = "Learn Python typing (type hints) with interactive online exercises!" %}
6-
{% block head %}{% endblock %}
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%221em%22 font-size=%2290%22>👩🏻‍💻</text></svg>">
4+
<meta charset="UTF-8" />
5+
{% set description = "Learn Python typing (type hints) with interactive online
6+
exercises!" %} {% block head %}{% endblock %}
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<link
9+
rel="icon"
10+
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%221em%22 font-size=%2290%22>👩🏻‍💻</text></svg>"
11+
/>
912
<!-- Open Graph -->
1013
<meta property="og:type" content="website" />
1114
<meta property="og:url" content="https://python-type-challenges.zeabur.app/" />
1215
<meta property="og:title" content="{{title}}" />
1316
<meta property="og:description" content="{{description}}" />
14-
<meta property="og:image" content="https://github.com/laike9m/images/assets/2592205/11e7cb79-caad-4be4-8b15-2732cbc698f3" />
17+
<meta
18+
property="og:image"
19+
content="https://github.com/laike9m/images/assets/2592205/11e7cb79-caad-4be4-8b15-2732cbc698f3"
20+
/>
1521
<!-- Twitter -->
1622
<meta name="twitter:card" content="summary" />
1723
<meta name="twitter:url" content="https://python-type-challenges.zeabur.app/" />
1824
<meta name="twitter:title" content="{{title}}" />
1925
<meta name="twitter:description" content="{{description}}" />
20-
<meta name="twitter:image" content="https://github.com/laike9m/images/assets/2592205/2012b6cc-7748-4708-b5aa-671dc27cfc18" />
26+
<meta
27+
name="twitter:image"
28+
content="https://github.com/laike9m/images/assets/2592205/2012b6cc-7748-4708-b5aa-671dc27cfc18"
29+
/>
2130
<meta name="twitter:creator" content="@laike9m" />
2231
<meta name="twitter:site" content="@laike9m" />
2332

24-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/picocss/1.5.10/pico.min.css">
33+
<link
34+
rel="stylesheet"
35+
href="https://cdnjs.cloudflare.com/ajax/libs/picocss/1.5.10/pico.min.css"
36+
/>
2537
<style type="text/css">
26-
/* override some style in picocss */
27-
h1, h2, h3, h4, h5, h6,
38+
/* override some style in picocss */
39+
h1,
40+
h2,
41+
h3,
42+
h4,
43+
h5,
44+
h6,
2845
p {
2946
margin-bottom: 0;
3047
}
3148
</style>
32-
<script data-goatcounter="https://laike9m.goatcounter.com/count"
33-
async src="{{url_for('static', filename='js/goatcounter.js')}}")></script>
34-
<script src="https://cdnjs.cloudflare.com/ajax/libs/htmx/1.9.10/htmx.min.js"
35-
crossorigin="anonymous" referrerpolicy="no-referrer">
36-
</script>
49+
<script
50+
data-goatcounter="https://laike9m.goatcounter.com/count"
51+
async
52+
src="{{url_for('static', filename='js/goatcounter.js')}}"
53+
)
54+
></script>
55+
<script
56+
src="https://cdnjs.cloudflare.com/ajax/libs/htmx/1.9.10/htmx.min.js"
57+
crossorigin="anonymous"
58+
referrerpolicy="no-referrer"
59+
></script>
3760
</head>
3861

3962
<body>
4063
{% block content %}{% endblock %}
4164
</body>
42-
4365
</html>

templates/index.html

+22-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
{% extends "base.html" %}
2-
3-
{% set title = "Python Type Challenges - Learn & Master Type Hints" %}
4-
{% block head %}
5-
{{ super() }}
1+
{% extends "base.html" %} {% set title = "Python Type Challenges - Learn & Master Type
2+
Hints" %} {% block head %} {{ super() }}
63
<title>{{title}}</title>
7-
<meta name="description" content="{{description}}">
8-
<meta name="google-site-verification" content="IB8oI3WkbGLDND4SMC6m_EiPmREdddxly_JUS-lbM_A" />
9-
<link href="https://fonts.loli.net/css2?family=IBM+Plex+Mono:wght@300;500;700&family=Poppins&display=swap"
10-
rel="stylesheet">
4+
<meta name="description" content="{{description}}" />
5+
<meta
6+
name="google-site-verification"
7+
content="IB8oI3WkbGLDND4SMC6m_EiPmREdddxly_JUS-lbM_A"
8+
/>
9+
<link
10+
href="https://fonts.loli.net/css2?family=IBM+Plex+Mono:wght@300;500;700&family=Poppins&display=swap"
11+
rel="stylesheet"
12+
/>
1113
<style>
1214
.main-container {
1315
display: flex;
1416
flex-direction: column;
1517
justify-content: center;
1618
align-items: center;
1719
padding: 1rem;
18-
font-family: 'IBM Plex Mono', monospace;
20+
font-family: "IBM Plex Mono", monospace;
1921
}
2022

2123
.title {
@@ -64,25 +66,26 @@
6466
}
6567
}
6668

67-
6869
@media only screen and (max-width: 1080px) and (min-width: 800px) {
6970
.challenges {
7071
grid-template-columns: repeat(2, 1fr);
7172
}
7273
}
7374
</style>
74-
{% endblock %}
75-
76-
{% block content %}
75+
{% endblock %} {% block content %}
7776

7877
<div class="main-container">
79-
<h1 class="title">Welcome to Python Type Challenges!</h1>
78+
<h1 style="margin-bottom: 0.5em;" class="title">Welcome to Python Type Challenges!</h1>
79+
<a style="margin-bottom: 1em;" href="https://zeabur.com?referralCode=laike9m&utm_source=laike9m">
80+
<img src=https://zeabur.com/deployed-on-zeabur-light.svg alt="Deployed on Zeabur"/>
81+
</a >
8082
<div class="challenges">
81-
{% for level, challenge_names in challenges_groupby_level.items() %}
82-
{% include 'components/challenge_card.html' with context %}
83-
{% endfor%}
83+
{% for level, challenge_names in challenges_groupby_level.items() %} {% include
84+
'components/challenge_card.html' with context %} {% endfor%}
85+
</div>
86+
<div class="random-button">
87+
<a href="/random" title="Pick a random challenge">Random Challenge 🔀</a>
8488
</div>
85-
<div class="random-button"><a href="/random" title="Pick a random challenge">Random Challenge 🔀</a></div>
8689
</div>
8790

8891
{% endblock %}

0 commit comments

Comments
 (0)