Skip to content

Commit 30fe0cb

Browse files
authored
Merge pull request #769 from BlackPythonDevs/755-add-discountspartnerships-section-to-the-site
Add partnerships page and move partnerships section
2 parents e74e11e + 4a8cec4 commit 30fe0cb

File tree

8 files changed

+55
-37
lines changed

8 files changed

+55
-37
lines changed

_data/partnerships.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"name": "TalkPython Training",
4+
"promo_code": "bpd-20pc-1c1da",
5+
"description": "When you use the <a href=\"https://training.talkpython.fm/black-python-devs\">Black Python Devs landing page</a> or use the promo code: <strong>bpd-20pc-1c1da</strong> at checkout, you will receive 10% off your course purchase. TalkPython Training will also donate 20% of the purchase to Black Python Devs.",
6+
"url": "https://training.talkpython.fm/black-python-devs",
7+
"logo": "/assets/images/talkpython.webp"
8+
},
9+
{
10+
"name": "O'Reilly Media",
11+
"promo_code": "https://oreillymedia.pxf.io/c/5713155/2126973/15173",
12+
"description": "<a href=\"https://oreillymedia.pxf.io/c/5713155/2126973/15173\">Sign up with our promo code</a> to receive a 30-day trial of O'Reilly's Learning Platform. If you sign up beyond the trial a percentage of your subscription will go to Black Python Devs.",
13+
"url": "/2024-09-09-oreilly-partnership/",
14+
"logo": "/assets/images/oreilly_logo_mark_red.svg"
15+
},
16+
{
17+
"name": "Books, Courses, and Trainings by Rodrigo Girão Serrão",
18+
"promo_code": "BLACKPYTHONDEVS",
19+
"description": "se the code BLACKPYTHONDEVS to get 10% off all ebooks, cheatsheets, and most courses, that I offer. When you use that code, you're also donating 20% of the value of your purchase to Black Python Devs",
20+
"url": "https://mathspp.com/black-python-devs",
21+
"logo": "assets/images/rodrigo.png"
22+
}
23+
]

_data/partnerships.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

_layouts/_includes/footer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ <h3>Quick link</h3>
1313
<li><a href="/about.html">About Us</a></li>
1414
<li><a href="/bpd-events/">BPD Events</a></li>
1515
<li><a href="/sponsored-events.html">Sponsored Events</a></li>
16+
<li><a href="/partnerships.html">Partnerships</a></li>
1617
<li><a href="/community.html">Community</a></li>
1718
<li><a href="/support.html">Support</a></li>
1819
</ul>

_layouts/_includes/partnerships.html

Lines changed: 0 additions & 22 deletions
This file was deleted.

_layouts/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ <h1 class="hero-text">Helping build communities for Black Pythonistas around the
2424

2525
{% include "_includes/latest-posts.html" %}
2626
{% include "_includes/join_us.html" %}
27-
{% include "_includes/partnerships.html" %}
2827
{% include "_includes/newsletter_form.html" %}
2928
{% endblock %}

_layouts/partnerships.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% extends "default.html" %}
2+
3+
{% block content %}
4+
<div>
5+
<h2>Partnerships</h2>
6+
7+
<p>We're happy to share with you our proud sponsors who offer their products at discounted rates and a portion of proceeds go to support Black Python Devs!</p>
8+
9+
{% for partner in data %}
10+
<article>
11+
<div class="grid">
12+
<div>
13+
<img src="{{partner['logo']}}" alt="{{partner['name']}} Logo" style="max-height: 14em" />
14+
</div>
15+
<div>
16+
<h3><a href="{{partner['url']}}">{{ partner['name'] }}</a></h3>
17+
<p>{{ partner['description'] }}</p>
18+
<a href="{{ partner[url] }}">Learn more</a>
19+
</div>
20+
</div>
21+
</article>
22+
{% endfor %}
23+
</div>
24+
{%endblock%}

app.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import json
33
import pathlib
44

5-
import yaml
6-
75
from render_engine import Site, Page, Collection, Blog
86
from render_engine_markdown import MarkdownPageParser
97

@@ -18,6 +16,7 @@
1816
"fa": "fa fa-handshake fa-fw",
1917
},
2018
{"text": "Community", "url": "/community.html", "fa": "fa fa-users fa-fw"},
19+
{"text": "Discounts", "url": "/partnerships.html", "fa": "fa-regular fa-handshake"},
2120
{
2221
"text": "Support Us",
2322
"url": "/support.html",
@@ -43,7 +42,6 @@ class Index(Page):
4342
@app.page
4443
class About(Page):
4544
template = "about.html"
46-
data = yaml.safe_load(pathlib.Path("_data/leadership.yaml").read_text())
4745

4846

4947
@app.page
@@ -62,6 +60,12 @@ class SponsoredEvents(Page):
6260
template_vars = {}
6361

6462

63+
@app.page
64+
class Partnerships(Page):
65+
template = "partnerships.html"
66+
data = json.loads(pathlib.Path("_data/partnerships.json").read_text())
67+
68+
6569
@app.collection
6670
class Pages(Collection):
6771
Parser = MarkdownPageParser

assets/images/rodrigo.png

62.2 KB
Loading

0 commit comments

Comments
 (0)