Skip to content

Commit b3b428d

Browse files
authored
Pycon liquid to jinja (#705)
* Add time to date field * Update from Liquid to Jinja templating
1 parent d0cd2d0 commit b3b428d

File tree

33 files changed

+216
-87
lines changed

33 files changed

+216
-87
lines changed

_layouts/_includes/latest-posts.html

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,43 @@
1-
{%- if page.list_title -%}
2-
<h2 class="post-list-heading">{{ page.list_title }}</h2>
3-
{% endif %}
1+
2+
{% block content %}
3+
{% for page in pages %}
4+
{%- if page.list_title -%}
5+
<h2 class="post-list-heading">{{ list_title }}</h2>
6+
{% endif %}
47
<article class="post-list">
58
<div>
69
<h3>
7-
<a class="" href="{{ post.url }}"> {{ post.title | escape }} </a>
10+
<a class="" href="{{ url }}"> {{ title | escape }} </a>
811
</h3>
9-
<p>{{ post.date }}</p>
12+
<p>{{ date }}</p>
1013
{%- if site.show_excerpts -%}
11-
<p class="post-description" style="margin-bottom: 2rem">{{ post.description}}</p>
14+
<p class="post-description" style="margin-bottom: 2rem">{{ description}}</p>
1215
</div>
1316
</article>
1417

1518
<div class="pager">
1619
<ul class="pagination">
1720
{%- if paginator.previous_page %}
18-
<li><a href="{{ paginator.previous_page_path | relative_url }}" class="previous-page">{{ paginator.previous_page }}</a></li>
21+
<li><a href="{{ paginator.previous_page_path | relative_url }}" class="previous-page">{{ paginator.previous_page
22+
}}</a></li>
1923
{%- else %}
20-
<li><div class="pager-edge"></div></li>
24+
<li>
25+
<div class="pager-edge"></div>
26+
</li>
2127
{%- endif %}
22-
<li><div class="current-page">{{ paginator.page }}</div></li>
28+
<li>
29+
<div class="current-page">{{ paginator.page }}</div>
30+
</li>
2331
{%- if paginator.next_page %}
2432
<li><a href="{{ paginator.next_page_path | relative_url }}" class="next-page">{{ paginator.next_page }}</a></li>
2533
{%- else %}
26-
<li><div class="pager-edge"></div></li>
34+
<li>
35+
<div class="pager-edge"></div>
36+
</li>
2737
{%- endif %}
2838
</ul>
2939
</div>
3040
{%- endif %}
41+
42+
{% endfor %}
43+
{% endblock %}

_layouts/_includes/newsletter_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<article>
2-
<h3>{{include.newsletter_title}}</h3>
2+
<h3>{{newsletter_title}}</h3>
33
<form action="https://buttondown.email/api/emails/embed-subscribe/black-python-devs" method="post" target="popupwindow" onsubmit="window.open('https://buttondown.email/black-python-devs', 'popupwindow')">
44
<fieldset role="group">
55
<input type="email" name="email" id="bd-email" placeholder="Enter your email" />

_layouts/_includes/partnerships.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ <h2>Partnerships</h2>
44
<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>
55

66
<div class="grid">
7-
{% for partner in site.data.partnerships %}
7+
{% for partner in partnerships %}
88
<article>
99
<div class="grid">
1010
<div>
11-
<img src="{{partner.logo}}" alt="{{partner.name}} Logo" style="max-height: 14em" />
11+
<img src="{{logo}}" alt="{{name}} Logo" style="max-height: 14em" />
1212
</div>
1313
<div>
14-
<h3><a href="{{partner.url}}">{{ partner.name }}</a></h3>
15-
<p>{{ partner.description }}</p>
16-
<a href="{{ partner.url }}">Learn more</a>
14+
<h3><a href="{{url}}">{{ name }}</a></h3>
15+
<p>{{ description }}</p>
16+
<a href="{{ url }}">Learn more</a>
1717
</div>
1818
</div>
1919
</article>

_layouts/post.html

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,41 @@
1-
---
2-
layout: default
3-
---
1+
{% extends "default.html" %}
2+
43
<section>
5-
{%- if page.featured_image -%}
6-
<div class="hero-banner">
7-
<img src="{{page.featured_image}}" class="featured-image" alt="author image">
8-
</div>
9-
{%- else -%}
10-
<div class="hero-banner">
11-
<img src="/assets/images/bpd_stacked.png" class="featured-image" alt="Hero image">
12-
</div>
13-
{%- endif -%}
4+
{%- if featured_image -%}
5+
<div class="hero-banner">
6+
<img src="{{ featured_image }}" class="featured-image" alt="author image">
7+
</div>
8+
{%- else -%}
9+
<div class="hero-banner">
10+
<img src="/assets/images/bpd_stacked.png" class="featured-image" alt="Hero image">
11+
</div>
12+
{%- endif -%}
1413
<article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">
1514
<header class="post-header">
16-
<h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}</h1>
15+
<h1 class="post-title p-name" itemprop="name headline">{{ title|e }}</h1>
1716
<p class="post-meta">
18-
{%- assign date_format = site.bpdevs.date_format | default: "%b %-d, %Y" -%}
19-
<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
20-
{{ page.date | date: date_format }}
21-
</time>
22-
{%- if page.modified_date -%}
23-
~
24-
{%- assign mdate = page.modified_date | date_to_xmlschema -%}
25-
<time class="dt-modified" datetime="{{ mdate }}" itemprop="dateModified">
26-
{{ mdate | date: date_format }}
27-
</time>
28-
{%- endif -%}
29-
{%- if page.author -%}
30-
• {% for author in page.author %}
17+
{%- for author in author %}
3118
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
32-
<span class="p-author h-card" itemprop="name">{{ author }}</span></span>
33-
{%- if forloop.last == false %}, {% endif -%}
34-
{% endfor %}
35-
{%- endif -%}
19+
<span class="p-author h-card" itemprop="name">{{ author }}</span>
20+
</span>
21+
{%- if not loop.last %}, {% endif -%}
22+
{%- endfor -%}
23+
3624
</p>
3725
</header>
3826
<div class="post-content e-content" itemprop="articleBody">
3927
{{ content }}
4028
</div>
41-
<a class="u-url" href="{{ page.url | relative_url }}" hidden></a>
4229
</article>
4330
</section>
4431

45-
{% assign author = site.data.authors | where:"name", page.author | first %}
32+
{% set author = authors | selectattr("name", "equalto", author) | first %}
4633
<section>
47-
{% if author.bio %}
48-
<hr />
49-
<h3>About {{author.name}}</h3>
50-
<p>{{author.bio}}</p>
51-
</section>
52-
{% endif %}
34+
{% if author and author.bio %}
35+
<hr />
36+
<h3>About {{author.name}}</h3>
37+
<p>{{author.bio|e}}</p>
38+
</section>
39+
{% endif %}
40+
41+
{% endblock %}

_posts/2023-10-20-djangoconus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: 2023-10-20
2+
date: 2023-10-20 08:00:00
33
description: Join us for a behind-the-scenes look at DjangoCon US 2023, where diversity
44
and inclusion came together to shape a powerful community of Python developers.
55
lang: en

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: Jay Miller
3-
date: 2023-11-11
3+
date: 2023-11-11 08:00:00
44
description: Discover how the US Conference Diversity Metric can inform your event's
55
location and create a more inclusive experience for attendees, with expert analysis
66
from Jay Miller.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: Jay Miller
3-
date: 2023-11-13
3+
date: 2023-11-13 08:00:00
44
description: Find out how the growing presence of Black Python Developers is shaping
55
the future of diversity in the tech industry through the DSF Elections.
66
lang: en

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: Jay Miller
3-
date: 2023-12-14
3+
date: 2023-12-14 08:00:00
44
description: Discover how the innovative team at Djangonaut Space is making a lasting
55
impact on the Django community with sustainable initiatives and groundbreaking projects.
66
lang: en

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: Jay Miller
3-
date: 2023-12-14
3+
date: 2023-12-14 08:00:00
44
description: Discover how Sarah Abderemane's selection to the Django Software Foundation
55
Board of Directors is a significant milestone for the thriving Black Python Devs
66
community.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: Jay Miller
3-
date: 2024-01-12
3+
date: 2024-01-12 08:00:00
44
description: Discover how Black Python Devs is supporting PyTexas, a premier regional
55
Python conference in Austin, TX, and learn about opportunities to attend for free
66
through ticket giveaways and speaker selection.

0 commit comments

Comments
 (0)