From b181b9d30dd3230826fabf7156dc67cc89f7a224 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Mon, 4 Nov 2024 22:35:06 -0500 Subject: [PATCH 1/9] add ollama_summarizer.py --- ollama_summarizer.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ollama_summarizer.py diff --git a/ollama_summarizer.py b/ollama_summarizer.py new file mode 100644 index 0000000..c243a46 --- /dev/null +++ b/ollama_summarizer.py @@ -0,0 +1,42 @@ +from rich.progress import track +import pathlib +import frontmatter +from langchain_core.prompts import PromptTemplate +from langchain_ollama import OllamaLLM +from langchain.chains.summarize import load_summarize_chain +from langchain_community.document_loaders.text import TextLoader +from langchain_text_splitters.character import RecursiveCharacterTextSplitter + + +llm = OllamaLLM(model="llama3.2") +prompt_template = """Write a subtle description to encourage the reader to read the blog post. + +{text} + +--- + +Instructions: +These are professional updates from Black Python Devs. +Use no more than 200 characters about the content. +Avoid clickbait phrases +Only return the response, no confirmation. +""" +prompt = PromptTemplate(template=prompt_template, input_variables=["text"]) +chain = load_summarize_chain(llm=llm, prompt=prompt) + +splitter = RecursiveCharacterTextSplitter( + separators=["\n", ".", "?"], + keep_separator="end", + chunk_size=1000, + chunk_overlap=200, +) + +for file in track(pathlib.Path("_posts").glob("*.md"), description="running"): + fm_file = frontmatter.loads(file.read_text()) + doc = TextLoader(file.absolute()).load()[0] + + if "description" in fm_file.keys(): + continue + summary = chain.invoke(input=splitter.split_documents([doc])) + fm_file["description"] = summary["output_text"].strip('"') + file.write_text(frontmatter.dumps(fm_file)) From a17d2e2fc87fe21a5a49c376f0d1ca61a6c9af40 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Mon, 4 Nov 2024 22:35:27 -0500 Subject: [PATCH 2/9] update requirements --- requirements-dev.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5af3538..786d556 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,17 @@ -ephemeral_port_reserve +# page-generation gh-issues + +# linting pre-commit + +# Automation +langchain +langchain_community +langchain_ollama +rich +python-frontmatter + +# Testing +ephemeral_port_reserve pytest-playwright pytest-xprocess From 152a84d8e591cf8346b9fb159671d5332fdc78b3 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Mon, 4 Nov 2024 22:35:54 -0500 Subject: [PATCH 3/9] update layouts to include descriptions --- _includes/latest-posts.html | 6 ++++-- _includes/posts.html | 6 ++++-- _layouts/default.html | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/_includes/latest-posts.html b/_includes/latest-posts.html index 4a52c65..b76ebfa 100644 --- a/_includes/latest-posts.html +++ b/_includes/latest-posts.html @@ -7,8 +7,10 @@

{{ page.list_title }}

{{ post.title | escape }}

- - {%- if site.show_excerpts -%} {{ post.excerpt }} {%- endif -%} +

{{ post.date | date: date_format }}

+ {%- if site.show_excerpts -%} +

{{ post.description}}

+ {%- endif -%} {%- assign count = count | plus:1 -%} {%- endif -%} {%- endfor -%} diff --git a/_includes/posts.html b/_includes/posts.html index 4907b5b..42040d6 100644 --- a/_includes/posts.html +++ b/_includes/posts.html @@ -20,8 +20,10 @@

{%- if site.show_excerpts -%} - {{ post.excerpt }} - {%- endif -%} +

+ {{ post.description }} +

+ {%- endif -%} {%- assign count = count | plus:1 -%} {%- endfor -%} diff --git a/_layouts/default.html b/_layouts/default.html index 06d4ebe..f77486c 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -3,7 +3,7 @@ - + {% if page.title %}{{ site.title }} | {{ page.title }}{% else %}{{ site.title }}{% endif %} From 60558f2434e78d7c95c618713ff26fb7a796b85b Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Mon, 4 Nov 2024 22:36:10 -0500 Subject: [PATCH 4/9] update posts --- _posts/2023-10-20-djangoconus.md | 10 +++++++--- ...at-is-the-us-conference-city-diversity-metric.md | 11 +++++++---- ...-black-python-devs-represent-in-dsf-elections.md | 6 ++++-- ...awarded-the-malcolm-tredinnick-memorial-prize.md | 8 ++++++-- ...ected-to-the-django-software-foundation-board.md | 6 ++++-- ...01-12-black-python-devs-is-sponsoring-pytexas.md | 7 +++++-- ...-marlene-mhangami-recognized-as-python-fellow.md | 9 ++++++--- _posts/2024-03-13-pycon-us-announcement.md | 9 ++++++--- _posts/2024-05-03-pycon_ng_2024.md | 9 ++++++--- _posts/2024-05-17-non-profit-announcement.md | 8 +++++--- .../2024-05-22-why-we-use-colored-and-coloured.md | 8 +++++--- ...dogbe-wins-inaugural-outstanding-pylady-award.md | 13 ++++++++----- ...-black-python-devs-running-for-2024-PSF-Board.md | 7 +++++-- ...-07-20-black-python-devs-partners-with-pyohio.md | 13 ++++++++----- ...15-python-morsels-black-python-devs-high-five.md | 7 +++++-- .../2024-08-16-talkpython-training-partnership.md | 6 ++++-- _posts/2024-09-09-oreilly-partnership.md | 8 +++++--- _posts/2024-10-13-black-python-devs-ghana-event.md | 8 +++++--- ...024-10-19-black-python-devs-leadership-summit.md | 9 ++++++--- _posts/2024-10-25-pycon-ug-2024.md | 9 ++++++--- _posts/2024-10-29-dsf-candidates-2025.md | 8 +++++--- _posts/2024-11-02-black-python-devs-pyho-2024.md | 8 +++++--- 22 files changed, 123 insertions(+), 64 deletions(-) diff --git a/_posts/2023-10-20-djangoconus.md b/_posts/2023-10-20-djangoconus.md index 4c28195..64d9491 100644 --- a/_posts/2023-10-20-djangoconus.md +++ b/_posts/2023-10-20-djangoconus.md @@ -1,8 +1,12 @@ --- -layout: post -lang: en -title: "DjangoCon US 2023" date: 2023-10-20 +description: Join us for a behind-the-scenes look at DjangoCon US 2023, where a vibrant + community came together to celebrate diversity and inclusivity in tech. Discover + how the event prioritized representation and created meaningful connections among + attendees. +lang: en +layout: post +title: DjangoCon US 2023 --- 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. diff --git a/_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md b/_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md index 0fae286..875d8f7 100644 --- a/_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md +++ b/_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md @@ -1,9 +1,12 @@ --- -title: "What is the US Conference City Diversity Metric" -layout: post -lang: en -date: 2023-11-11 author: Jay Miller +date: 2023-11-11 +description: Discover how the US Conference City Diversity Metric can inform your + event's location and create a more inclusive experience. Learn what cities score + well on diversity and why. +lang: en +layout: post +title: What is the US Conference City Diversity Metric --- 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. diff --git a/_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md b/_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md index 5d16c65..d0834cd 100644 --- a/_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md +++ b/_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md @@ -1,9 +1,11 @@ --- -title: "Black Python Devs Represent in DSF Elections" -date: 2023-11-13 author: Jay Miller +date: 2023-11-13 +description: Discover how Black Python Devs are shaping the DSF Elections and making + a lasting impact in the industry. lang: en layout: post +title: Black Python Devs Represent in DSF Elections --- The DSF Board Elections have opened and voting is available for DSF members now until 27 November 2023 (Anywhere on Earth). diff --git a/_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md b/_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md index 3a67d5a..02e7a30 100644 --- a/_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md +++ b/_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md @@ -1,9 +1,13 @@ --- -title: "Dawn Wages, Sarah Abderemane and Djangonaut Space Awarded the Malcolm Tredinnick Memorial Prize" -date: 2023-12-14 author: Jay Miller +date: 2023-12-14 +description: Meet the winners of the Malcolm Tredinnick Memorial Prize, recognized + for their outstanding service to community through innovative Django projects and + initiatives. lang: en layout: post +title: Dawn Wages, Sarah Abderemane and Djangonaut Space Awarded the Malcolm Tredinnick + Memorial Prize --- 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. diff --git a/_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md b/_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md index 014b858..258f373 100644 --- a/_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md +++ b/_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md @@ -1,9 +1,11 @@ --- -title: "Sarah Abderemane Selected to the Django Software Foundation Board of Directors" -date: 2023-12-14 author: Jay Miller +date: 2023-12-14 +description: Meet Sarah Abderemane, a new member of the Django Software Foundation + Board of Directors, representing the thriving Black Python Devs community. lang: en layout: post +title: Sarah Abderemane Selected to the Django Software Foundation Board of Directors --- 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. diff --git a/_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md b/_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md index 23b653e..782b200 100644 --- a/_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md +++ b/_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md @@ -1,9 +1,12 @@ --- -title: "Black Python Devs is Sponsoring PyTexas" -date: 2024-01-12 author: Jay Miller +date: 2024-01-12 +description: Get ready for PyTexas! Join us as we sponsor this year's regional Python + conference in Austin, TX. Learn, network, and share your knowledge with others - + plus snag a free ticket through our community sponsorship! lang: en layout: post +title: Black Python Devs is Sponsoring PyTexas --- 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! diff --git a/_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md b/_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md index 03da04d..c93f5c7 100644 --- a/_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md +++ b/_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md @@ -1,8 +1,11 @@ --- -layout: post -lang: en -title: "Marlene Mhangami Recognized as Python Fellow for Q3 2023" date: 2024-01-25 +description: Meet Marlene Mhangami, a devoted leader in the Python community, recognized + by the Python Software Foundation for her outstanding contributions to diversity + and inclusion. +lang: en +layout: post +title: Marlene Mhangami Recognized as Python Fellow for Q3 2023 --- 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). diff --git a/_posts/2024-03-13-pycon-us-announcement.md b/_posts/2024-03-13-pycon-us-announcement.md index f005ca3..41b6c7d 100644 --- a/_posts/2024-03-13-pycon-us-announcement.md +++ b/_posts/2024-03-13-pycon-us-announcement.md @@ -1,8 +1,11 @@ --- -layout: post -lang: en -title: "Black Python Devs x PyCon US" date: 2024-03-13 +description: Join us at PyCon US as we celebrate diversity in the Python community. + Discover our initiatives, meet fellow Black developers, and be part of shaping a + more inclusive global community. +lang: en +layout: post +title: Black Python Devs x PyCon US --- PyCon US is coming and Black Python Devs will represented strongly. diff --git a/_posts/2024-05-03-pycon_ng_2024.md b/_posts/2024-05-03-pycon_ng_2024.md index 3b269cd..885ba56 100644 --- a/_posts/2024-05-03-pycon_ng_2024.md +++ b/_posts/2024-05-03-pycon_ng_2024.md @@ -1,9 +1,12 @@ --- -layout: post -title: Black Python Devs is sponsoring PyCon Nigeria 2024 date: 2024-05-03 -lang: en +description: Black Python Devs is supporting PyCon Nigeria 2024, providing opportunities + for students and investing in the next generation of developers. Learn more about + our initiative and how you can participate. featured_image: /assets/images/bpdxpyconng.jpg +lang: en +layout: post +title: Black Python Devs is sponsoring PyCon Nigeria 2024 --- 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. diff --git a/_posts/2024-05-17-non-profit-announcement.md b/_posts/2024-05-17-non-profit-announcement.md index ec533fa..f8eaab6 100644 --- a/_posts/2024-05-17-non-profit-announcement.md +++ b/_posts/2024-05-17-non-profit-announcement.md @@ -1,9 +1,11 @@ --- -layout: post -lang: en -title: Black Python Devs is now a Non-Profit Under the GNOME Foundation date: 2024-05-16 +description: Discover how a historic partnership between GNOME Foundation and Black + Python Devs is empowering tech diversity and innovation. featured_image: /assets/images/BPD_STACKED_featured.png +lang: en +layout: post +title: Black Python Devs is now a Non-Profit Under the GNOME Foundation --- 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. diff --git a/_posts/2024-05-22-why-we-use-colored-and-coloured.md b/_posts/2024-05-22-why-we-use-colored-and-coloured.md index e3441c8..d27b791 100644 --- a/_posts/2024-05-22-why-we-use-colored-and-coloured.md +++ b/_posts/2024-05-22-why-we-use-colored-and-coloured.md @@ -1,9 +1,11 @@ --- -layout: post -lang: en -title: Why We Use Black, Colored and Coloured when Describing Members date: 2024-05-22 +description: "Exploring the nuances of inclusive language: why Black, Colored, and + coloured coexist in our community." featured_image: /assets/images/BPD_PyCon_2024_cropped.jpg +lang: en +layout: post +title: Why We Use Black, Colored and Coloured when Describing Members --- 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. diff --git a/_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md b/_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md index 5b6de15..1840bfb 100644 --- a/_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md +++ b/_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md @@ -1,10 +1,13 @@ --- -layout: "post" -lang: "en" -author: "Anotida Expected Msiiwa" -title: "Abigail Mesrenyame Dogbe Honored with Inaugural Outstanding PyLady Award" +author: Anotida Expected Msiiwa date: 2024-01-25 -featured_image: "/assets/images/opa_winners_2024.png" +description: Meet Abigail Mesrenyame Dogbe, a dedicated member of Black Python Devs + and recipient of the Inaugural Outstanding PyLady award. Learn how her exceptional + contributions to open-source community are inspiring women in STEM. +featured_image: /assets/images/opa_winners_2024.png +lang: en +layout: post +title: Abigail Mesrenyame Dogbe Honored with Inaugural Outstanding PyLady Award --- 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. diff --git a/_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md b/_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md index 2138bd4..dae6261 100644 --- a/_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md +++ b/_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md @@ -1,9 +1,12 @@ --- -title: "Black Python Developers Running for the 2024 Python Software Foundation Board" -date: 2024-07-03 author: Anotida Expected Msiiwa +date: 2024-07-03 +description: Meet four exceptional Black Python developers running for the Python + Software Foundation Board, dedicated to promoting diversity and inclusion in the + Python community. lang: en layout: post +title: Black Python Developers Running for the 2024 Python Software Foundation Board --- 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. diff --git a/_posts/2024-07-20-black-python-devs-partners-with-pyohio.md b/_posts/2024-07-20-black-python-devs-partners-with-pyohio.md index 18c7c99..c3f283f 100644 --- a/_posts/2024-07-20-black-python-devs-partners-with-pyohio.md +++ b/_posts/2024-07-20-black-python-devs-partners-with-pyohio.md @@ -1,10 +1,13 @@ --- -title: "Black Python Devs Partners with PyOhio to Foster Community Growth" +author: Anotida Expected Msiiwa date: 2024-07-20 -author: "Anotida Expected Msiiwa" -lang: "en" -layout: "post" -featured_image: "/assets/images/black-python-devs-x-pyohio.png" +description: Discover how Black Python Devs is amplifying diversity in the Ohio Python + community through a new partnership with PyOhio. Learn about the benefits and impact + of this collaboration on fostering growth and inclusivity in the years to come. +featured_image: /assets/images/black-python-devs-x-pyohio.png +lang: en +layout: post +title: Black Python Devs Partners with PyOhio to Foster Community Growth --- 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. diff --git a/_posts/2024-08-15-python-morsels-black-python-devs-high-five.md b/_posts/2024-08-15-python-morsels-black-python-devs-high-five.md index 75f4249..cea7cf3 100644 --- a/_posts/2024-08-15-python-morsels-black-python-devs-high-five.md +++ b/_posts/2024-08-15-python-morsels-black-python-devs-high-five.md @@ -1,8 +1,11 @@ --- -title: Black Python Devs Partners with Python Morsels for High Five Launch +author: Jay Miller date: 2024-08-15 +description: Kickstart your Python skills with a comprehensive 10-week course offering + daily exercises, community support, and real-world applications. Get $30 off with + our exclusive discount code! lang: en -author: Jay Miller +title: Black Python Devs Partners with Python Morsels for High Five Launch --- 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. diff --git a/_posts/2024-08-16-talkpython-training-partnership.md b/_posts/2024-08-16-talkpython-training-partnership.md index 631b762..2abfe2a 100644 --- a/_posts/2024-08-16-talkpython-training-partnership.md +++ b/_posts/2024-08-16-talkpython-training-partnership.md @@ -1,8 +1,10 @@ --- -title: "Talk Python Training Partners with Black Python Devs" -date: 2024-08-16 author: Jay Miller +date: 2024-08-16 +description: Discover how TalkPython Training is supporting diversity in Python programming + with a new partnership that benefits both your learning and their mission. lang: en +title: Talk Python Training Partners with Black Python Devs --- We are excited to announce a new partnership with TalkPython Training! diff --git a/_posts/2024-09-09-oreilly-partnership.md b/_posts/2024-09-09-oreilly-partnership.md index a1dcdb5..5957264 100644 --- a/_posts/2024-09-09-oreilly-partnership.md +++ b/_posts/2024-09-09-oreilly-partnership.md @@ -1,9 +1,11 @@ --- -title: "O'Reilly Media Partners with Black Python Devs" -date: 2024-09-09 author: Jay Miller -lang: en +date: 2024-09-09 +description: Learn with O'Reilly Media while supporting diversity in the Python community. + Discover how this partnership will empower Black Pythonistas. featured_image: /assets/images/bpd_x_oreilly.jpg +lang: en +title: O'Reilly Media Partners with Black Python Devs --- We are excited to announce a new partnership with O'Reilly Media! diff --git a/_posts/2024-10-13-black-python-devs-ghana-event.md b/_posts/2024-10-13-black-python-devs-ghana-event.md index 37897a2..9c6cb1b 100644 --- a/_posts/2024-10-13-black-python-devs-ghana-event.md +++ b/_posts/2024-10-13-black-python-devs-ghana-event.md @@ -1,9 +1,11 @@ --- -title: "Black Python Devs Ghana Connect Meetup" -date: 2024-10-13 author: Abigail Afi Gbadago -lang: en +date: 2024-10-13 +description: Join us for a heartwarming story of innovation and perseverance in Ghana. + Meet the individuals who chose Python to turn their passions into reality. featured_image: /assets/images/bpd_ghana_connect1.webp +lang: en +title: Black Python Devs Ghana Connect Meetup --- 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. diff --git a/_posts/2024-10-19-black-python-devs-leadership-summit.md b/_posts/2024-10-19-black-python-devs-leadership-summit.md index ccd7c0e..ff01236 100644 --- a/_posts/2024-10-19-black-python-devs-leadership-summit.md +++ b/_posts/2024-10-19-black-python-devs-leadership-summit.md @@ -1,9 +1,12 @@ --- -title: "Black Python Devs Leadership Summit" -date: 2024-10-19 author: Abigail Afi Gbadago -lang: en +date: 2024-10-19 +description: Join us for a recap of the highly successful Black Python Devs Leadership + Summit, where leaders shared insights on succession planning, mental health, and + leadership skills. featured_image: /assets/images/bpd-leadership-summit-1.jpeg +lang: en +title: Black Python Devs Leadership Summit --- The Black Python Devs Leadership Summit, which took place on September 21st at 8 a.m. was a successful event. diff --git a/_posts/2024-10-25-pycon-ug-2024.md b/_posts/2024-10-25-pycon-ug-2024.md index 04cb989..edd0d15 100644 --- a/_posts/2024-10-25-pycon-ug-2024.md +++ b/_posts/2024-10-25-pycon-ug-2024.md @@ -1,9 +1,12 @@ --- -title: "Black Python Devs at PyconUG 2024" +author: Tobias Thomas (Toe•bias HT) date: 2024-10-25 -author: "Tobias Thomas (Toe•bias HT)" +description: Meet the next generation of African Python developers who attended PyconUG + 2024, sponsored by BlackPythonDevs. Hear their inspiring stories and learn about + the community's impact. +featured_image: /assets/images/PyconUG-BPD-X-Conference-Logos.png lang: en -featured_image: "/assets/images/PyconUG-BPD-X-Conference-Logos.png" +title: Black Python Devs at PyconUG 2024 --- Wednesday, 9th, October, 2024, was Uganda's Independence day. diff --git a/_posts/2024-10-29-dsf-candidates-2025.md b/_posts/2024-10-29-dsf-candidates-2025.md index a9ec3d5..9f925f3 100644 --- a/_posts/2024-10-29-dsf-candidates-2025.md +++ b/_posts/2024-10-29-dsf-candidates-2025.md @@ -1,10 +1,12 @@ --- -title: "Black Python Devs Running for the DSF" -date: 2024-10-29 author: Jay Miller +date: 2024-10-29 +description: Discover how a diverse group of Black Python Developers are shaping the + future of Django and Python communities worldwide. +featured_image: /assets/images/django-foundation-election.webp lang: en layout: post -featured_image: /assets/images/django-foundation-election.webp +title: Black Python Devs Running for the DSF --- The [DSF Board Candidates have been announced](https://www.djangoproject.com/weblog/2024/oct/28/2025-dsf-board-candidates/) and voting is now open for DSF members now until 15 November (Anywhere on Earth). diff --git a/_posts/2024-11-02-black-python-devs-pyho-2024.md b/_posts/2024-11-02-black-python-devs-pyho-2024.md index ceec064..c616d74 100644 --- a/_posts/2024-11-02-black-python-devs-pyho-2024.md +++ b/_posts/2024-11-02-black-python-devs-pyho-2024.md @@ -1,9 +1,11 @@ --- -title: "Amplifying Voices and Fostering Community: Black Python Devs as a Catalyst." -date: 2024-11-02 author: Kafui Alordo -lang: en +date: 2024-11-02 +description: Discover how Black Python Devs is amplifying underrepresented voices + and fostering community in the Python ecosystem. featured_image: /assets/images/bpd_pyho_2024.jpg +lang: en +title: "Amplifying Voices and Fostering Community: Black Python Devs as a Catalyst." --- We’re ecstatically pleased as a community to share in the celebration of the incredible impact of Black Python Devs (BPD) on PyHo 2024 (the regional Python community conference of the people of Volta). Through an unwavering commitment to empower underrepresented/underserved developers. From f530e97a5045b7fa967411c991a1e8f2f50aea1c Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Tue, 5 Nov 2024 21:58:29 -0500 Subject: [PATCH 5/9] update posts with default layout --- .pre-commit-config.yaml | 8 +++ _includes/latest-posts.html | 2 +- _includes/posts.html | 2 +- _layouts/default.html | 2 +- _posts/2023-10-20-djangoconus.md | 6 +-- ...the-us-conference-city-diversity-metric.md | 6 +-- ...-python-devs-represent-in-dsf-elections.md | 4 +- ...d-the-malcolm-tredinnick-memorial-prize.md | 5 +- ...to-the-django-software-foundation-board.md | 5 +- ...black-python-devs-is-sponsoring-pytexas.md | 6 +-- ...ne-mhangami-recognized-as-python-fellow.md | 6 +-- _posts/2024-03-13-pycon-us-announcement.md | 5 +- _posts/2024-05-03-pycon_ng_2024.md | 6 +-- _posts/2024-05-17-non-profit-announcement.md | 4 +- ...4-05-22-why-we-use-colored-and-coloured.md | 5 +- ...wins-inaugural-outstanding-pylady-award.md | 4 +- ...-python-devs-running-for-2024-PSF-Board.md | 6 +-- ...-black-python-devs-partners-with-pyohio.md | 6 +-- ...hon-morsels-black-python-devs-high-five.md | 7 +-- ...4-08-16-talkpython-training-partnership.md | 6 ++- _posts/2024-09-09-oreilly-partnership.md | 6 ++- ...024-10-13-black-python-devs-ghana-event.md | 5 +- ...-19-black-python-devs-leadership-summit.md | 7 +-- _posts/2024-10-25-pycon-ug-2024.md | 7 +-- _posts/2024-10-29-dsf-candidates-2025.md | 5 +- .../2024-11-02-black-python-devs-pyho-2024.md | 5 +- ollama_summarizer.py | 12 ++--- requirements-dev.txt | 1 + tests/test.py | 51 ++++++++++++++++++- 29 files changed, 133 insertions(+), 67 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e195f41..06929b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,3 +32,11 @@ repos: rev: 23.9.1 hooks: - id: black + - repo: local + hooks: + - id: check-for-layout + name: check-for-layout + files: _posts/.*.md + entry: python update_layout.py check + language: python + additional_dependencies: [typer, python-frontmatter, typing-extensions] diff --git a/_includes/latest-posts.html b/_includes/latest-posts.html index b76ebfa..f926d64 100644 --- a/_includes/latest-posts.html +++ b/_includes/latest-posts.html @@ -9,7 +9,7 @@

{{ post.date | date: date_format }}

{%- if site.show_excerpts -%} -

{{ post.description}}

+

{{ post.description}}

{%- endif -%} {%- assign count = count | plus:1 -%} {%- endif -%} {%- endfor -%} diff --git a/_includes/posts.html b/_includes/posts.html index 42040d6..583964f 100644 --- a/_includes/posts.html +++ b/_includes/posts.html @@ -20,7 +20,7 @@

{%- if site.show_excerpts -%} -

+

{{ post.description }}

{%- endif -%} diff --git a/_layouts/default.html b/_layouts/default.html index f77486c..9e3363f 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -3,7 +3,7 @@ - + {% if page.title %}{{ site.title }} | {{ page.title }}{% else %}{{ site.title }}{% endif %} diff --git a/_posts/2023-10-20-djangoconus.md b/_posts/2023-10-20-djangoconus.md index 64d9491..866de3e 100644 --- a/_posts/2023-10-20-djangoconus.md +++ b/_posts/2023-10-20-djangoconus.md @@ -1,9 +1,7 @@ --- date: 2023-10-20 -description: Join us for a behind-the-scenes look at DjangoCon US 2023, where a vibrant - community came together to celebrate diversity and inclusivity in tech. Discover - how the event prioritized representation and created meaningful connections among - attendees. +description: Join us for a behind-the-scenes look at DjangoCon US 2023, where diversity + and inclusion came together to shape a powerful community of Python developers. lang: en layout: post title: DjangoCon US 2023 diff --git a/_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md b/_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md index 875d8f7..8acaa3e 100644 --- a/_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md +++ b/_posts/2023-11-11-what-is-the-us-conference-city-diversity-metric.md @@ -1,9 +1,9 @@ --- author: Jay Miller date: 2023-11-11 -description: Discover how the US Conference City Diversity Metric can inform your - event's location and create a more inclusive experience. Learn what cities score - well on diversity and why. +description: Discover how the US Conference Diversity Metric can inform your event's + location and create a more inclusive experience for attendees, with expert analysis + from Jay Miller. lang: en layout: post title: What is the US Conference City Diversity Metric diff --git a/_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md b/_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md index d0834cd..70f7812 100644 --- a/_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md +++ b/_posts/2023-11-13-black-python-devs-represent-in-dsf-elections.md @@ -1,8 +1,8 @@ --- author: Jay Miller date: 2023-11-13 -description: Discover how Black Python Devs are shaping the DSF Elections and making - a lasting impact in the industry. +description: Find out how the growing presence of Black Python Developers is shaping + the future of diversity in the tech industry through the DSF Elections. lang: en layout: post title: Black Python Devs Represent in DSF Elections diff --git a/_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md b/_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md index 02e7a30..0d83e72 100644 --- a/_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md +++ b/_posts/2023-12-14-dawn-wages-sarah-abderemane-and-djangonaut-space-awarded-the-malcolm-tredinnick-memorial-prize.md @@ -1,9 +1,8 @@ --- author: Jay Miller date: 2023-12-14 -description: Meet the winners of the Malcolm Tredinnick Memorial Prize, recognized - for their outstanding service to community through innovative Django projects and - initiatives. +description: Discover how the innovative team at Djangonaut Space is making a lasting + impact on the Django community with sustainable initiatives and groundbreaking projects. lang: en layout: post title: Dawn Wages, Sarah Abderemane and Djangonaut Space Awarded the Malcolm Tredinnick diff --git a/_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md b/_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md index 258f373..a6e7043 100644 --- a/_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md +++ b/_posts/2023-12-14-sarah-abderemane-selected-to-the-django-software-foundation-board.md @@ -1,8 +1,9 @@ --- author: Jay Miller date: 2023-12-14 -description: Meet Sarah Abderemane, a new member of the Django Software Foundation - Board of Directors, representing the thriving Black Python Devs community. +description: Discover how Sarah Abderemane's selection to the Django Software Foundation + Board of Directors is a significant milestone for the thriving Black Python Devs + community. lang: en layout: post title: Sarah Abderemane Selected to the Django Software Foundation Board of Directors diff --git a/_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md b/_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md index 782b200..6783e68 100644 --- a/_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md +++ b/_posts/2024-01-12-black-python-devs-is-sponsoring-pytexas.md @@ -1,9 +1,9 @@ --- author: Jay Miller date: 2024-01-12 -description: Get ready for PyTexas! Join us as we sponsor this year's regional Python - conference in Austin, TX. Learn, network, and share your knowledge with others - - plus snag a free ticket through our community sponsorship! +description: Discover how Black Python Devs is supporting PyTexas, a premier regional + Python conference in Austin, TX, and learn about opportunities to attend for free + through ticket giveaways and speaker selection. lang: en layout: post title: Black Python Devs is Sponsoring PyTexas diff --git a/_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md b/_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md index c93f5c7..7d07b48 100644 --- a/_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md +++ b/_posts/2024-01-25-marlene-mhangami-recognized-as-python-fellow.md @@ -1,8 +1,8 @@ --- date: 2024-01-25 -description: Meet Marlene Mhangami, a devoted leader in the Python community, recognized - by the Python Software Foundation for her outstanding contributions to diversity - and inclusion. +description: Meet Marlene Mhangami, a trailblazing leader in the Python community + recognized for her exceptional contributions as PSF Chair and DEI Working Group + member, now highlighted as a Q3 2023 Python Fellow. lang: en layout: post title: Marlene Mhangami Recognized as Python Fellow for Q3 2023 diff --git a/_posts/2024-03-13-pycon-us-announcement.md b/_posts/2024-03-13-pycon-us-announcement.md index 41b6c7d..e475de6 100644 --- a/_posts/2024-03-13-pycon-us-announcement.md +++ b/_posts/2024-03-13-pycon-us-announcement.md @@ -1,8 +1,7 @@ --- date: 2024-03-13 -description: Join us at PyCon US as we celebrate diversity in the Python community. - Discover our initiatives, meet fellow Black developers, and be part of shaping a - more inclusive global community. +description: Explore how Black Python Devs is shaping the future of the Python community + through a range of events and activities at PyCon US. lang: en layout: post title: Black Python Devs x PyCon US diff --git a/_posts/2024-05-03-pycon_ng_2024.md b/_posts/2024-05-03-pycon_ng_2024.md index 885ba56..04a5031 100644 --- a/_posts/2024-05-03-pycon_ng_2024.md +++ b/_posts/2024-05-03-pycon_ng_2024.md @@ -1,8 +1,8 @@ --- date: 2024-05-03 -description: Black Python Devs is supporting PyCon Nigeria 2024, providing opportunities - for students and investing in the next generation of developers. Learn more about - our initiative and how you can participate. +description: Discover how Black Python Devs is empowering the next generation of developers + through its partnership with PyCon Nigeria 2024 and learn about exclusive opportunities + for students. featured_image: /assets/images/bpdxpyconng.jpg lang: en layout: post diff --git a/_posts/2024-05-17-non-profit-announcement.md b/_posts/2024-05-17-non-profit-announcement.md index f8eaab6..3cf203d 100644 --- a/_posts/2024-05-17-non-profit-announcement.md +++ b/_posts/2024-05-17-non-profit-announcement.md @@ -1,7 +1,7 @@ --- date: 2024-05-16 -description: Discover how a historic partnership between GNOME Foundation and Black - Python Devs is empowering tech diversity and innovation. +description: Discover how a historic partnership between two influential organizations + is revolutionizing tech diversity and innovation in the open-source world. featured_image: /assets/images/BPD_STACKED_featured.png lang: en layout: post diff --git a/_posts/2024-05-22-why-we-use-colored-and-coloured.md b/_posts/2024-05-22-why-we-use-colored-and-coloured.md index d27b791..d341cfd 100644 --- a/_posts/2024-05-22-why-we-use-colored-and-coloured.md +++ b/_posts/2024-05-22-why-we-use-colored-and-coloured.md @@ -1,7 +1,8 @@ --- date: 2024-05-22 -description: "Exploring the nuances of inclusive language: why Black, Colored, and - coloured coexist in our community." +description: Join us as we explore a nuanced approach to inclusive language, examining + the complexities of terms like "Black", "Colored", and "coloured" in describing + our community members. featured_image: /assets/images/BPD_PyCon_2024_cropped.jpg lang: en layout: post diff --git a/_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md b/_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md index 1840bfb..b646987 100644 --- a/_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md +++ b/_posts/2024-05-25-abigail-mesrenyame-dogbe-wins-inaugural-outstanding-pylady-award.md @@ -2,8 +2,8 @@ author: Anotida Expected Msiiwa date: 2024-01-25 description: Meet Abigail Mesrenyame Dogbe, a dedicated member of Black Python Devs - and recipient of the Inaugural Outstanding PyLady award. Learn how her exceptional - contributions to open-source community are inspiring women in STEM. + and recipient of the Inaugural Outstanding PyLady award, whose inspiring contributions + to the open-source community are empowering women in STEM. featured_image: /assets/images/opa_winners_2024.png lang: en layout: post diff --git a/_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md b/_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md index dae6261..26f8657 100644 --- a/_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md +++ b/_posts/2024-07-03-black-python-devs-running-for-2024-PSF-Board.md @@ -1,9 +1,9 @@ --- author: Anotida Expected Msiiwa date: 2024-07-03 -description: Meet four exceptional Black Python developers running for the Python - Software Foundation Board, dedicated to promoting diversity and inclusion in the - Python community. +description: Join us in learning about four exceptional Black Python developers who + are shaping the future of the Python community and running for a crucial role on + the Python Software Foundation Board. lang: en layout: post title: Black Python Developers Running for the 2024 Python Software Foundation Board diff --git a/_posts/2024-07-20-black-python-devs-partners-with-pyohio.md b/_posts/2024-07-20-black-python-devs-partners-with-pyohio.md index c3f283f..c0ec033 100644 --- a/_posts/2024-07-20-black-python-devs-partners-with-pyohio.md +++ b/_posts/2024-07-20-black-python-devs-partners-with-pyohio.md @@ -1,9 +1,9 @@ --- author: Anotida Expected Msiiwa date: 2024-07-20 -description: Discover how Black Python Devs is amplifying diversity in the Ohio Python - community through a new partnership with PyOhio. Learn about the benefits and impact - of this collaboration on fostering growth and inclusivity in the years to come. +description: Discover how Black Python Devs is teaming up with PyOhio to create a + more inclusive and diverse community, supporting and amplifying the voices of Black + developers in Ohio and beyond. featured_image: /assets/images/black-python-devs-x-pyohio.png lang: en layout: post diff --git a/_posts/2024-08-15-python-morsels-black-python-devs-high-five.md b/_posts/2024-08-15-python-morsels-black-python-devs-high-five.md index cea7cf3..1131731 100644 --- a/_posts/2024-08-15-python-morsels-black-python-devs-high-five.md +++ b/_posts/2024-08-15-python-morsels-black-python-devs-high-five.md @@ -1,10 +1,11 @@ --- author: Jay Miller date: 2024-08-15 -description: Kickstart your Python skills with a comprehensive 10-week course offering - daily exercises, community support, and real-world applications. Get $30 off with - our exclusive discount code! +description: Discover how to kickstart your Python skills with a comprehensive 10-week + course, featuring daily exercises, community support, and real-world applications + - now available with an exclusive $30 off offer. lang: en +layout: post title: Black Python Devs Partners with Python Morsels for High Five Launch --- diff --git a/_posts/2024-08-16-talkpython-training-partnership.md b/_posts/2024-08-16-talkpython-training-partnership.md index 2abfe2a..14d1327 100644 --- a/_posts/2024-08-16-talkpython-training-partnership.md +++ b/_posts/2024-08-16-talkpython-training-partnership.md @@ -1,9 +1,11 @@ --- author: Jay Miller date: 2024-08-16 -description: Discover how TalkPython Training is supporting diversity in Python programming - with a new partnership that benefits both your learning and their mission. +description: Learn how TalkPython Training's new partnership with Black Python Devs + is driving greater diversity and benefiting learners through a unique opportunity + to support both your education and the community. lang: en +layout: post title: Talk Python Training Partners with Black Python Devs --- diff --git a/_posts/2024-09-09-oreilly-partnership.md b/_posts/2024-09-09-oreilly-partnership.md index 5957264..562d805 100644 --- a/_posts/2024-09-09-oreilly-partnership.md +++ b/_posts/2024-09-09-oreilly-partnership.md @@ -1,10 +1,12 @@ --- author: Jay Miller date: 2024-09-09 -description: Learn with O'Reilly Media while supporting diversity in the Python community. - Discover how this partnership will empower Black Pythonistas. +description: Get the inside scoop on O'Reilly Media's innovative partnership with + Black Python Devs and discover how it's revolutionizing access to high-quality learning + resources for the Black Python community. featured_image: /assets/images/bpd_x_oreilly.jpg lang: en +layout: post title: O'Reilly Media Partners with Black Python Devs --- diff --git a/_posts/2024-10-13-black-python-devs-ghana-event.md b/_posts/2024-10-13-black-python-devs-ghana-event.md index 9c6cb1b..88578da 100644 --- a/_posts/2024-10-13-black-python-devs-ghana-event.md +++ b/_posts/2024-10-13-black-python-devs-ghana-event.md @@ -1,10 +1,11 @@ --- author: Abigail Afi Gbadago date: 2024-10-13 -description: Join us for a heartwarming story of innovation and perseverance in Ghana. - Meet the individuals who chose Python to turn their passions into reality. +description: Discover how Ghanaian developers turned their passion for coding into + a career with inspiring stories of perseverance and innovation in Python. featured_image: /assets/images/bpd_ghana_connect1.webp lang: en +layout: post title: Black Python Devs Ghana Connect Meetup --- diff --git a/_posts/2024-10-19-black-python-devs-leadership-summit.md b/_posts/2024-10-19-black-python-devs-leadership-summit.md index ff01236..4c96a17 100644 --- a/_posts/2024-10-19-black-python-devs-leadership-summit.md +++ b/_posts/2024-10-19-black-python-devs-leadership-summit.md @@ -1,11 +1,12 @@ --- author: Abigail Afi Gbadago date: 2024-10-19 -description: Join us for a recap of the highly successful Black Python Devs Leadership - Summit, where leaders shared insights on succession planning, mental health, and - leadership skills. +description: Join Abigail Afi Gbadago and other leaders at the highly successful Black + Python Devs Leadership Summit as they shared insights on succession planning, mental + health, and leadership skills in a day of engaging talks and interactive sessions. featured_image: /assets/images/bpd-leadership-summit-1.jpeg lang: en +layout: post title: Black Python Devs Leadership Summit --- diff --git a/_posts/2024-10-25-pycon-ug-2024.md b/_posts/2024-10-25-pycon-ug-2024.md index edd0d15..5b9f8e6 100644 --- a/_posts/2024-10-25-pycon-ug-2024.md +++ b/_posts/2024-10-25-pycon-ug-2024.md @@ -1,11 +1,12 @@ --- author: Tobias Thomas (Toe•bias HT) date: 2024-10-25 -description: Meet the next generation of African Python developers who attended PyconUG - 2024, sponsored by BlackPythonDevs. Hear their inspiring stories and learn about - the community's impact. +description: Discover the inspiring stories of Uganda's next generation African Python + developers who attended PyconUG 2024 and learn about their experiences in a vibrant + tech community. featured_image: /assets/images/PyconUG-BPD-X-Conference-Logos.png lang: en +layout: post title: Black Python Devs at PyconUG 2024 --- diff --git a/_posts/2024-10-29-dsf-candidates-2025.md b/_posts/2024-10-29-dsf-candidates-2025.md index 9f925f3..6f710c4 100644 --- a/_posts/2024-10-29-dsf-candidates-2025.md +++ b/_posts/2024-10-29-dsf-candidates-2025.md @@ -1,8 +1,9 @@ --- author: Jay Miller date: 2024-10-29 -description: Discover how a diverse group of Black Python Developers are shaping the - future of Django and Python communities worldwide. +description: Discover how a new generation of Black Python Developers is shaping the + future of Django and the global tech community, and learn about their inspiring + stories and impact on the world. featured_image: /assets/images/django-foundation-election.webp lang: en layout: post diff --git a/_posts/2024-11-02-black-python-devs-pyho-2024.md b/_posts/2024-11-02-black-python-devs-pyho-2024.md index c616d74..14da676 100644 --- a/_posts/2024-11-02-black-python-devs-pyho-2024.md +++ b/_posts/2024-11-02-black-python-devs-pyho-2024.md @@ -1,10 +1,11 @@ --- author: Kafui Alordo date: 2024-11-02 -description: Discover how Black Python Devs is amplifying underrepresented voices - and fostering community in the Python ecosystem. +description: Discover how Black Python Devs is redefining the future of Python's open + source ecosystem by creating a safe and inclusive space for underrepresented developers. featured_image: /assets/images/bpd_pyho_2024.jpg lang: en +layout: post title: "Amplifying Voices and Fostering Community: Black Python Devs as a Catalyst." --- diff --git a/ollama_summarizer.py b/ollama_summarizer.py index c243a46..c3e7713 100644 --- a/ollama_summarizer.py +++ b/ollama_summarizer.py @@ -9,17 +9,17 @@ llm = OllamaLLM(model="llama3.2") -prompt_template = """Write a subtle description to encourage the reader to read the blog post. +prompt_template = """Write a subtle description to encourage the reader to read the blog post. {text} --- Instructions: +Only return the response, no confirmation. These are professional updates from Black Python Devs. -Use no more than 200 characters about the content. +Use no more than 1 sentence. Avoid clickbait phrases -Only return the response, no confirmation. """ prompt = PromptTemplate(template=prompt_template, input_variables=["text"]) chain = load_summarize_chain(llm=llm, prompt=prompt) @@ -35,8 +35,8 @@ fm_file = frontmatter.loads(file.read_text()) doc = TextLoader(file.absolute()).load()[0] - if "description" in fm_file.keys(): - continue + # if "description" in fm_file.keys(): + # continue summary = chain.invoke(input=splitter.split_documents([doc])) - fm_file["description"] = summary["output_text"].strip('"') + fm_file["description"] = summary["output_text"].strip('"').strip("\n") file.write_text(frontmatter.dumps(fm_file)) diff --git a/requirements-dev.txt b/requirements-dev.txt index 786d556..2f19572 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,6 +3,7 @@ gh-issues # linting pre-commit +typer # Automation langchain diff --git a/tests/test.py b/tests/test.py index c5cc2f9..8c20e34 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,6 +1,8 @@ import pathlib +from typing import Generator import pytest +import frontmatter from xprocess import ProcessStarter from playwright.sync_api import Page, expect, sync_playwright @@ -90,7 +92,7 @@ def test_headers_in_language(page_url: tuple[Page, str], route: str) -> None: ) def test_bpdevs_title_en(page_url: tuple[Page, str], title: str, url: str) -> None: page, live_server_url = page_url - page.goto(f"{live_server_url}/{url}") + page.goto(f"{live_server_url}{url}") expect(page).to_have_title(f"Black Python Devs | {title}") @@ -99,3 +101,50 @@ def test_mailto_bpdevs(page_url: tuple[Page, str]) -> None: page.goto(live_server_url) mailto = page.get_by_role("link", name="email") expect(mailto).to_have_attribute("href", "mailto:contact@blackpythondevs.com") + + +@pytest.mark.parametrize( + "url", + ( + "/", + "/blog", + ), +) +def test_page_description_in_index_and_blog(page_url: tuple[Page, str], url: str): + """Checks for the descriptions data in the blog posts. There should be some objects with the class `post-description`""" + page, live_server_url = page_url + page.goto(f"{live_server_url}{url}") + expect(page.locator("p.post-description").first).to_be_visible() + expect(page.locator("p.post-description").first).not_to_be_empty() + + +def stem_description( + path: pathlib.Path, +) -> Generator[tuple[str, frontmatter.Post], None, None]: + """iterate throug a list returning the stem of the file and the contents""" + + for entry in path.glob("*.md"): + yield (entry.stem, frontmatter.loads(entry.read_text())) + + +blog_posts = stem_description(pathlib.Path("_posts")) + + +@pytest.mark.parametrize("post", list(blog_posts)) +def test_page_blog_posts( + page_url: tuple[Page, str], post: tuple[str, frontmatter.Post] +): + """Checks that the meta page description matches the description of the post""" + page, live_server_url = page_url + entry_stem, frontmatter = post + url = f"{live_server_url}/{entry_stem}/" + page.goto(url) + page.wait_for_selector( + 'meta[name="description"]', + timeout=5000, + state="attached", + ) + assert ( + page.locator('meta[name="description"]').get_attribute("content") + == frontmatter["description"] + ) From cd44c5af7f4f80968d573471df2b6c274e2689a4 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Tue, 5 Nov 2024 21:59:50 -0500 Subject: [PATCH 6/9] update posts with default layout --- update_layout.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 update_layout.py diff --git a/update_layout.py b/update_layout.py new file mode 100644 index 0000000..d3a08d1 --- /dev/null +++ b/update_layout.py @@ -0,0 +1,46 @@ +import typing +import typer +import pathlib +import frontmatter + + +app = typer.Typer(no_args_is_help=True) + + +def fix_file(target_file: pathlib.Path): + fm_file = frontmatter.loads(target_file.read_text()) + + if "layout" not in fm_file.metadata: + fm_file["layout"] = "post" + target_file.write_text(frontmatter.dumps(fm_file)) + + +@app.command(name="fix") +def fix_files( + target_files: typing.List[pathlib.Path], +) -> None: + """Adds the default layout if the post is missing.""" + for target_file in target_files: + fix_file(target_file) + + +@app.command(name="check") +def check_file( + target_files: typing.List[pathlib.Path], +) -> None: + """Check a file for the layout attribute""" + + ret_code = 0 + for target_file in target_files: + fm_file = frontmatter.loads(target_file.read_text()) + + if "layout" not in fm_file.metadata: + print("%s is missing the `layout` value. Applying layout: post.") + fix_file(target_file) + ret_code = 1 + + typer.Exit(code=ret_code) + + +if __name__ == "__main__": + app() From d2d55f2993365a44ea25493b5bb3b2ed1650ad29 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Tue, 5 Nov 2024 22:13:07 -0500 Subject: [PATCH 7/9] update MAINTAINERS with update_layout --- MAINTAINERS.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 5c09acd..01f9946 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -14,6 +14,7 @@ First off, thank you for considering contributing to Black Python Devs website. - [Translations](#translations) - [Styling](#styling) - [Adding New Pages](#adding-new-pages) +- Post Validation # Before You Get Started @@ -203,6 +204,34 @@ ROUTES = [ - Make sure your new page renders correctly and all links work as expected. +## Layout Validation + +### Automatic Layout Updates + +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. + +### Tools and Features + +#### `update_layout.py` CLI Tool + +- Checks and applies missing layout fields to post files +- Can process multiple posts simultaneously +- Usage: + ```bash + python update_layout.py fix|check path/to/post1.md [path/to/post2.md ...] + ``` + +#### Pre-commit Hook + +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: + +- Run automatically before each commit +- Check all modified `.md` files in the `_posts` directory +- Apply the necessary layout field if missing +- Fail the commit initially but fix the issue, allowing you to commit again + +For manual layout checks and updates, you can always run the `update_layout.py` tool directly. + --- Remember, when in doubt, don't hesitate to ask for help in our Discord community or in a GitHub issue! From 9e5af7d74c0b89811f9747e9216521b5f20f9340 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Tue, 5 Nov 2024 23:11:10 -0500 Subject: [PATCH 8/9] simplify cli --- update_layout.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/update_layout.py b/update_layout.py index d3a08d1..1362ccd 100644 --- a/update_layout.py +++ b/update_layout.py @@ -7,23 +7,6 @@ app = typer.Typer(no_args_is_help=True) -def fix_file(target_file: pathlib.Path): - fm_file = frontmatter.loads(target_file.read_text()) - - if "layout" not in fm_file.metadata: - fm_file["layout"] = "post" - target_file.write_text(frontmatter.dumps(fm_file)) - - -@app.command(name="fix") -def fix_files( - target_files: typing.List[pathlib.Path], -) -> None: - """Adds the default layout if the post is missing.""" - for target_file in target_files: - fix_file(target_file) - - @app.command(name="check") def check_file( target_files: typing.List[pathlib.Path], @@ -36,7 +19,8 @@ def check_file( if "layout" not in fm_file.metadata: print("%s is missing the `layout` value. Applying layout: post.") - fix_file(target_file) + fm_file["layout"] = "post" + target_file.write_text(frontmatter.dumps(fm_file)) ret_code = 1 typer.Exit(code=ret_code) From 667497a04850d828289083adbb5e2ea86fa1627a Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Tue, 5 Nov 2024 23:14:26 -0500 Subject: [PATCH 9/9] update pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06929b1..a6768e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,6 +37,6 @@ repos: - id: check-for-layout name: check-for-layout files: _posts/.*.md - entry: python update_layout.py check + entry: python update_layout.py language: python additional_dependencies: [typer, python-frontmatter, typing-extensions]