Skip to content

Commit

Permalink
Add Zeabur affliation button
Browse files Browse the repository at this point in the history
  • Loading branch information
laike9m committed Jul 2, 2024
1 parent 07e0ec6 commit 559a027
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 37 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


@app.errorhandler(404)
def page_not_found(e):
def page_not_found(err):
return redirect("/")


Expand Down
56 changes: 39 additions & 17 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,65 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
{% set description = "Learn Python typing (type hints) with interactive online exercises!" %}
{% block head %}{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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>">
<meta charset="UTF-8" />
{% set description = "Learn Python typing (type hints) with interactive online
exercises!" %} {% block head %}{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<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>"
/>
<!-- Open Graph -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://python-type-challenges.zeabur.app/" />
<meta property="og:title" content="{{title}}" />
<meta property="og:description" content="{{description}}" />
<meta property="og:image" content="https://github.com/laike9m/images/assets/2592205/11e7cb79-caad-4be4-8b15-2732cbc698f3" />
<meta
property="og:image"
content="https://github.com/laike9m/images/assets/2592205/11e7cb79-caad-4be4-8b15-2732cbc698f3"
/>
<!-- Twitter -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:url" content="https://python-type-challenges.zeabur.app/" />
<meta name="twitter:title" content="{{title}}" />
<meta name="twitter:description" content="{{description}}" />
<meta name="twitter:image" content="https://github.com/laike9m/images/assets/2592205/2012b6cc-7748-4708-b5aa-671dc27cfc18" />
<meta
name="twitter:image"
content="https://github.com/laike9m/images/assets/2592205/2012b6cc-7748-4708-b5aa-671dc27cfc18"
/>
<meta name="twitter:creator" content="@laike9m" />
<meta name="twitter:site" content="@laike9m" />

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/picocss/1.5.10/pico.min.css">
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/picocss/1.5.10/pico.min.css"
/>
<style type="text/css">
/* override some style in picocss */
h1, h2, h3, h4, h5, h6,
/* override some style in picocss */
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin-bottom: 0;
}
</style>
<script data-goatcounter="https://laike9m.goatcounter.com/count"
async src="{{url_for('static', filename='js/goatcounter.js')}}")></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/htmx/1.9.10/htmx.min.js"
crossorigin="anonymous" referrerpolicy="no-referrer">
</script>
<script
data-goatcounter="https://laike9m.goatcounter.com/count"
async
src="{{url_for('static', filename='js/goatcounter.js')}}"
)
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/htmx/1.9.10/htmx.min.js"
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
</head>

<body>
{% block content %}{% endblock %}
</body>

</html>
41 changes: 22 additions & 19 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{% extends "base.html" %}

{% set title = "Python Type Challenges - Learn & Master Type Hints" %}
{% block head %}
{{ super() }}
{% extends "base.html" %} {% set title = "Python Type Challenges - Learn & Master Type
Hints" %} {% block head %} {{ super() }}
<title>{{title}}</title>
<meta name="description" content="{{description}}">
<meta name="google-site-verification" content="IB8oI3WkbGLDND4SMC6m_EiPmREdddxly_JUS-lbM_A" />
<link href="https://fonts.loli.net/css2?family=IBM+Plex+Mono:wght@300;500;700&family=Poppins&display=swap"
rel="stylesheet">
<meta name="description" content="{{description}}" />
<meta
name="google-site-verification"
content="IB8oI3WkbGLDND4SMC6m_EiPmREdddxly_JUS-lbM_A"
/>
<link
href="https://fonts.loli.net/css2?family=IBM+Plex+Mono:wght@300;500;700&family=Poppins&display=swap"
rel="stylesheet"
/>
<style>
.main-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 1rem;
font-family: 'IBM Plex Mono', monospace;
font-family: "IBM Plex Mono", monospace;
}

.title {
Expand Down Expand Up @@ -64,25 +66,26 @@
}
}


@media only screen and (max-width: 1080px) and (min-width: 800px) {
.challenges {
grid-template-columns: repeat(2, 1fr);
}
}
</style>
{% endblock %}

{% block content %}
{% endblock %} {% block content %}

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

{% endblock %}

0 comments on commit 559a027

Please sign in to comment.