Skip to content

Commit 0e0013f

Browse files
authored
Merge pull request #563 from BlackPythonDevs/556-auto-generate-post-descriptions
556 auto generate post descriptions
2 parents 98aeeae + 667497a commit 0e0013f

31 files changed

+313
-71
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ repos:
3232
rev: 23.9.1
3333
hooks:
3434
- id: black
35+
- repo: local
36+
hooks:
37+
- id: check-for-layout
38+
name: check-for-layout
39+
files: _posts/.*.md
40+
entry: python update_layout.py
41+
language: python
42+
additional_dependencies: [typer, python-frontmatter, typing-extensions]

MAINTAINERS.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ First off, thank you for considering contributing to Black Python Devs website.
1414
- [Translations](#translations)
1515
- [Styling](#styling)
1616
- [Adding New Pages](#adding-new-pages)
17+
- Post Validation
1718

1819
# Before You Get Started
1920

@@ -203,6 +204,34 @@ ROUTES = [
203204

204205
- Make sure your new page renders correctly and all links work as expected.
205206

207+
## Layout Validation
208+
209+
### Automatic Layout Updates
210+
211+
To ensure consistency across all blog posts, we've implemented automatic layout validation and updating functionality. This helps maintain proper frontmatter configuration for all Markdown files in the `_posts` directory.
212+
213+
### Tools and Features
214+
215+
#### `update_layout.py` CLI Tool
216+
217+
- Checks and applies missing layout fields to post files
218+
- Can process multiple posts simultaneously
219+
- Usage:
220+
```bash
221+
python update_layout.py fix|check path/to/post1.md [path/to/post2.md ...]
222+
```
223+
224+
#### Pre-commit Hook
225+
226+
We've implemented a custom pre-commit hook that automatically runs the `update_layout.py` update check on any `.md` files in the `_posts` directory that are being committed. The hook will:
227+
228+
- Run automatically before each commit
229+
- Check all modified `.md` files in the `_posts` directory
230+
- Apply the necessary layout field if missing
231+
- Fail the commit initially but fix the issue, allowing you to commit again
232+
233+
For manual layout checks and updates, you can always run the `update_layout.py` tool directly.
234+
206235
---
207236

208237
Remember, when in doubt, don't hesitate to ask for help in our Discord community or in a GitHub issue!

_includes/latest-posts.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ <h2 class="post-list-heading">{{ page.list_title }}</h2>
77
<h3>
88
<a class="" href="{{ post.url | relative_url }}"> {{ post.title | escape }} </a>
99
</h3>
10-
<span class="post-meta">{{ post.date | date: date_format }}</span>
11-
{%- if site.show_excerpts -%} {{ post.excerpt }} {%- endif -%}
10+
<p>{{ post.date | date: date_format }}</p>
11+
{%- if site.show_excerpts -%}
12+
<p class="post-description" style="margin-bottom: 2rem">{{ post.description}}</p>
13+
{%- endif -%}
1214
</div>
1315
{%- assign count = count | plus:1 -%} {%- endif -%} {%- endfor -%}
1416
</article>

_includes/posts.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ <h3>
2020
</h3>
2121
<span class="post-meta">{{ post.date | date: date_format }}</span>
2222
{%- if site.show_excerpts -%}
23-
{{ post.excerpt }}
24-
{%- endif -%}
23+
<p class="post-description">
24+
{{ post.description }}
25+
</p>
26+
{%- endif -%}
2527
</div>
2628
{%- assign count = count | plus:1 -%}
2729
{%- endfor -%}

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}" />
6+
<meta name="description" content="{% if page.description%}{{ page.description | escape }}{% else %}{{ site.description }}{% endif %}" />
77
<title>{% if page.title %}{{ site.title }} | {{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
88
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}" />
99
<link rel="stylesheet" href="{{ '/assets/css/pico.min.css' | relative_url }}" />

_posts/2023-10-20-djangoconus.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
2-
layout: post
3-
lang: en
4-
title: "DjangoCon US 2023"
52
date: 2023-10-20
3+
description: Join us for a behind-the-scenes look at DjangoCon US 2023, where diversity
4+
and inclusion came together to shape a powerful community of Python developers.
5+
lang: en
6+
layout: post
7+
title: DjangoCon US 2023
68
---
79

810
In Durham, North Carolina, approximately 300 Django developers gathered from all over the world for [DjangoCon US](https://2023.djangocon.us/). This event showcased the knowledge of the community and celebrated its cultural diversity and the diversity of its hosting city. The event was located at the Marriot Convention Center, in the heart of the city. There were many resturants and smaller attractions.

_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: "What is the US Conference City Diversity Metric"
3-
layout: post
4-
lang: en
5-
date: 2023-11-11
62
author: Jay Miller
3+
date: 2023-11-11
4+
description: Discover how the US Conference Diversity Metric can inform your event's
5+
location and create a more inclusive experience for attendees, with expert analysis
6+
from Jay Miller.
7+
lang: en
8+
layout: post
9+
title: What is the US Conference City Diversity Metric
710
---
811

912
In 2022 at DjangoCon I took a look at the location of all of the PyCon US locations and their makeup by race. I highlighted that in the first 10 years of PyCon's existence, 9 of those 10 events were in culturally diverse cities like Atlanta, Washington DC and Chicago. The second half was during Python's boom and the need for larger venues started pushing conferences to more affordable areas with large international airports. These were places like Salt Lake City, Portland, and Montreal.

_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
2-
title: "Black Python Devs Represent in DSF Elections"
3-
date: 2023-11-13
42
author: Jay Miller
3+
date: 2023-11-13
4+
description: Find out how the growing presence of Black Python Developers is shaping
5+
the future of diversity in the tech industry through the DSF Elections.
56
lang: en
67
layout: post
8+
title: Black Python Devs Represent in DSF Elections
79
---
810

911
The DSF Board Elections have opened and voting is available for DSF members now until 27 November 2023 (Anywhere on Earth).

_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: "Dawn Wages, Sarah Abderemane and Djangonaut Space Awarded the Malcolm Tredinnick Memorial Prize"
3-
date: 2023-12-14
42
author: Jay Miller
3+
date: 2023-12-14
4+
description: Discover how the innovative team at Djangonaut Space is making a lasting
5+
impact on the Django community with sustainable initiatives and groundbreaking projects.
56
lang: en
67
layout: post
8+
title: Dawn Wages, Sarah Abderemane and Djangonaut Space Awarded the Malcolm Tredinnick
9+
Memorial Prize
710
---
811

912
Each year the _Django Software Foundation_, selects a person or group that exemplifies the outstanding service to community as shown by the award's namesake.

_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: "Sarah Abderemane Selected to the Django Software Foundation Board of Directors"
3-
date: 2023-12-14
42
author: Jay Miller
3+
date: 2023-12-14
4+
description: Discover how Sarah Abderemane's selection to the Django Software Foundation
5+
Board of Directors is a significant milestone for the thriving Black Python Devs
6+
community.
57
lang: en
68
layout: post
9+
title: Sarah Abderemane Selected to the Django Software Foundation Board of Directors
710
---
811

912
This year Black Python Devs were strongly represented with [41% of the folks running](https://blackpythondevs.github.io/2023-11-13-black-python-devs-represent-in-dsf-elections/) belonging to the community.

_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: "Black Python Devs is Sponsoring PyTexas"
3-
date: 2024-01-12
42
author: Jay Miller
3+
date: 2024-01-12
4+
description: Discover how Black Python Devs is supporting PyTexas, a premier regional
5+
Python conference in Austin, TX, and learn about opportunities to attend for free
6+
through ticket giveaways and speaker selection.
57
lang: en
68
layout: post
9+
title: Black Python Devs is Sponsoring PyTexas
710
---
811

912
We've got some fantastic updates to share about our upcoming involvement with PyTexas! We're thrilled to announce that we are a community sponsor for PyTexas!

_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
2-
layout: post
3-
lang: en
4-
title: "Marlene Mhangami Recognized as Python Fellow for Q3 2023"
52
date: 2024-01-25
3+
description: Meet Marlene Mhangami, a trailblazing leader in the Python community
4+
recognized for her exceptional contributions as PSF Chair and DEI Working Group
5+
member, now highlighted as a Q3 2023 Python Fellow.
6+
lang: en
7+
layout: post
8+
title: Marlene Mhangami Recognized as Python Fellow for Q3 2023
69
---
710

811
Every quarter, the Python Software Foundation recognizes individuals in the community for their exceptional contributions to the Python community. Black Python Devs member [Marlene Mangami](http://marlenemhangami.com/) was selected as a fellow for [Q3 2023](https://pyfound.blogspot.com/2024/01/announcing-python-software-foundation.html).

_posts/2024-03-13-pycon-us-announcement.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
2-
layout: post
3-
lang: en
4-
title: "Black Python Devs x PyCon US"
52
date: 2024-03-13
3+
description: Explore how Black Python Devs is shaping the future of the Python community
4+
through a range of events and activities at PyCon US.
5+
lang: en
6+
layout: post
7+
title: Black Python Devs x PyCon US
68
---
79

810
PyCon US is coming and Black Python Devs will represented strongly.

_posts/2024-05-03-pycon_ng_2024.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
layout: post
3-
title: Black Python Devs is sponsoring PyCon Nigeria 2024
42
date: 2024-05-03
5-
lang: en
3+
description: Discover how Black Python Devs is empowering the next generation of developers
4+
through its partnership with PyCon Nigeria 2024 and learn about exclusive opportunities
5+
for students.
66
featured_image: /assets/images/bpdxpyconng.jpg
7+
lang: en
8+
layout: post
9+
title: Black Python Devs is sponsoring PyCon Nigeria 2024
710
---
811

912
We're happy to annouce that Black Python Devs will be sponsoring [PyCon Nigeria 2024](https://ng.pycon.org/) as a part of our _Build Local Community Initiative_. This commitment comes with the added benefit of free student ticket for qualifying Black Python Devs members.

_posts/2024-05-17-non-profit-announcement.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
2-
layout: post
3-
lang: en
4-
title: Black Python Devs is now a Non-Profit Under the GNOME Foundation
52
date: 2024-05-16
3+
description: Discover how a historic partnership between two influential organizations
4+
is revolutionizing tech diversity and innovation in the open-source world.
65
featured_image: /assets/images/BPD_STACKED_featured.png
6+
lang: en
7+
layout: post
8+
title: Black Python Devs is now a Non-Profit Under the GNOME Foundation
79
---
810

911
The [GNOME Foundation](https://foundation.gnome.org/) and Black Python Devs are proud to announce that our organizations have entered into a fiscal sponsorship agreement for the mutual benefit of our communities and the greater OS world.

_posts/2024-05-22-why-we-use-colored-and-coloured.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
layout: post
3-
lang: en
4-
title: Why We Use Black, Colored and Coloured when Describing Members
52
date: 2024-05-22
3+
description: Join us as we explore a nuanced approach to inclusive language, examining
4+
the complexities of terms like "Black", "Colored", and "coloured" in describing
5+
our community members.
66
featured_image: /assets/images/BPD_PyCon_2024_cropped.jpg
7+
lang: en
8+
layout: post
9+
title: Why We Use Black, Colored and Coloured when Describing Members
710
---
811

912
We've received concerns from (up to this point) entirely white folks on the internet about our usage of words like _Colored_ and _Coloured_ when regarding some of our members.

_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
2-
layout: "post"
3-
lang: "en"
4-
author: "Anotida Expected Msiiwa"
5-
title: "Abigail Mesrenyame Dogbe Honored with Inaugural Outstanding PyLady Award"
2+
author: Anotida Expected Msiiwa
63
date: 2024-01-25
7-
featured_image: "/assets/images/opa_winners_2024.png"
4+
description: Meet Abigail Mesrenyame Dogbe, a dedicated member of Black Python Devs
5+
and recipient of the Inaugural Outstanding PyLady award, whose inspiring contributions
6+
to the open-source community are empowering women in STEM.
7+
featured_image: /assets/images/opa_winners_2024.png
8+
lang: en
9+
layout: post
10+
title: Abigail Mesrenyame Dogbe Honored with Inaugural Outstanding PyLady Award
811
---
912

1013
Every year, the PyLadies community recognizes individuals for their remarkable contributions to the open-source community with the [Inaugural Outstanding PyLady award](https://kit.pyladies.com/en/latest/global/award.html). This year, we are thrilled to announce that [Abigail Mesrenyame Dogbe](https://mesrenyamedogbe.hashnode.dev), a dedicated member of Black Python Devs, has been honored with this prestigious award at PyCon 2024 in Pittsburgh, PA.

_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: "Black Python Developers Running for the 2024 Python Software Foundation Board"
3-
date: 2024-07-03
42
author: Anotida Expected Msiiwa
3+
date: 2024-07-03
4+
description: Join us in learning about four exceptional Black Python developers who
5+
are shaping the future of the Python community and running for a crucial role on
6+
the Python Software Foundation Board.
57
lang: en
68
layout: post
9+
title: Black Python Developers Running for the 2024 Python Software Foundation Board
710
---
811

912
We are thrilled to announce that four exceptional Black Python developers are running for the [Python Software Foundation (PSF)](https://www.python.org/psf-landing/) Board of Directors this year. The candidates are Monica Oyugi, Abigail Dogbe, Darrell Jenkins, and Jeremy Tanner. Their dedication and contributions to the Python community are truly inspiring.

_posts/2024-07-20-black-python-devs-partners-with-pyohio.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
2-
title: "Black Python Devs Partners with PyOhio to Foster Community Growth"
2+
author: Anotida Expected Msiiwa
33
date: 2024-07-20
4-
author: "Anotida Expected Msiiwa"
5-
lang: "en"
6-
layout: "post"
7-
featured_image: "/assets/images/black-python-devs-x-pyohio.png"
4+
description: Discover how Black Python Devs is teaming up with PyOhio to create a
5+
more inclusive and diverse community, supporting and amplifying the voices of Black
6+
developers in Ohio and beyond.
7+
featured_image: /assets/images/black-python-devs-x-pyohio.png
8+
lang: en
9+
layout: post
10+
title: Black Python Devs Partners with PyOhio to Foster Community Growth
811
---
912

1013
We are thrilled to announce a significant new partnership between Black Python Devs and [PyOhio](https://www.pyohio.org/2024/)! This collaboration marks a major milestone in our mission to amplify the involvement of Black developers within the Python community, with a particular focus on the Ohio region. Our financial support for PyOhio is designed to stimulate community engagement and foster growth in the years to come.

_posts/2024-08-15-python-morsels-black-python-devs-high-five.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
---
2-
title: Black Python Devs Partners with Python Morsels for High Five Launch
2+
author: Jay Miller
33
date: 2024-08-15
4+
description: Discover how to kickstart your Python skills with a comprehensive 10-week
5+
course, featuring daily exercises, community support, and real-world applications
6+
- now available with an exclusive $30 off offer.
47
lang: en
5-
author: Jay Miller
8+
layout: post
9+
title: Black Python Devs Partners with Python Morsels for High Five Launch
610
---
711

812
We’re thrilled to announce a that Python Morsels is offering us an affiliate partnership for [Python High Five](https://www.pythonmorsels.com/high-five/), a comprehensive 10-week Python course starting in early September.

_posts/2024-08-16-talkpython-training-partnership.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
---
2-
title: "Talk Python Training Partners with Black Python Devs"
3-
date: 2024-08-16
42
author: Jay Miller
3+
date: 2024-08-16
4+
description: Learn how TalkPython Training's new partnership with Black Python Devs
5+
is driving greater diversity and benefiting learners through a unique opportunity
6+
to support both your education and the community.
57
lang: en
8+
layout: post
9+
title: Talk Python Training Partners with Black Python Devs
610
---
711

812
We are excited to announce a new partnership with TalkPython Training!

_posts/2024-09-09-oreilly-partnership.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
---
2-
title: "O'Reilly Media Partners with Black Python Devs"
3-
date: 2024-09-09
42
author: Jay Miller
5-
lang: en
3+
date: 2024-09-09
4+
description: Get the inside scoop on O'Reilly Media's innovative partnership with
5+
Black Python Devs and discover how it's revolutionizing access to high-quality learning
6+
resources for the Black Python community.
67
featured_image: /assets/images/bpd_x_oreilly.jpg
8+
lang: en
9+
layout: post
10+
title: O'Reilly Media Partners with Black Python Devs
711
---
812

913
We are excited to announce a new partnership with O'Reilly Media!

_posts/2024-10-13-black-python-devs-ghana-event.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: "Black Python Devs Ghana Connect Meetup"
3-
date: 2024-10-13
42
author: Abigail Afi Gbadago
5-
lang: en
3+
date: 2024-10-13
4+
description: Discover how Ghanaian developers turned their passion for coding into
5+
a career with inspiring stories of perseverance and innovation in Python.
66
featured_image: /assets/images/bpd_ghana_connect1.webp
7+
lang: en
8+
layout: post
9+
title: Black Python Devs Ghana Connect Meetup
710
---
811

912
On Saturday, August 17th, 2024, Stancy and Afi hosted the Black Python Devs Ghana Connect Meetup at Accra Mall, Pizza Inn. The event started at 1 PM with a warm introduction and welcome remarks from our moderator, Theresa Seyram Agbenyegah. We had an enthusiastic turnout of 22 participants, each of whom introduced themselves during an icebreaker session.

_posts/2024-10-19-black-python-devs-leadership-summit.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
---
2-
title: "Black Python Devs Leadership Summit"
3-
date: 2024-10-19
42
author: Abigail Afi Gbadago
5-
lang: en
3+
date: 2024-10-19
4+
description: Join Abigail Afi Gbadago and other leaders at the highly successful Black
5+
Python Devs Leadership Summit as they shared insights on succession planning, mental
6+
health, and leadership skills in a day of engaging talks and interactive sessions.
67
featured_image: /assets/images/bpd-leadership-summit-1.jpeg
8+
lang: en
9+
layout: post
10+
title: Black Python Devs Leadership Summit
711
---
812

913
The Black Python Devs Leadership Summit, which took place on September 21st at 8 a.m. was a successful event.

0 commit comments

Comments
 (0)