Skip to content

Commit

Permalink
This commit:
Browse files Browse the repository at this point in the history
- Adds `matching` filter to return matching posts for authors
- Corrects missing team member data
- Improves the post layout
- Fixes post partials for reusability

Obvious problems: there's still questions around when `page.` is necessary in the posts layout, and when it causes problems.
  • Loading branch information
beechnut committed Jun 3, 2024
1 parent ec2ad0d commit dd12521
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ module.exports = function (config) {
config.addFilter("limit", function (arr, limit) {
return arr.slice(0, limit);
});
config.addFilter('matching', function(collection, author) {
return collection.filter((post) => {
return post.data.authors.includes(author)
});
});

// FIXME (see other FIXME)
config.addFilter('markdownify', markdownify);
Expand Down
42 changes: 23 additions & 19 deletions _data/team_members.csv
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
id,first_name,last_name,full_name,redirect_from
18F,18F,,18F,/team/18F/
aaron,Aaron,Snow,,/team/aaron/
aaron-burk,Aaron,Burk,,/team/aaronburk/
aaron-sauers,Aaron,Sauers,,
aaron,Aaron,Snow,,/team/aaron/
abdulrahim-tahlil,Abdulrahim,Tahlil,,
adam-drake,Adam,Drake,,
adam-kendall,Adam,Kendall,,/team/adam-kendall/
adrian-webb,Adrian,Webb,,/team/adrian-webb/
afeld,Aidan,Feldman,,/team/afeld/
afeld,Ai,Feldman,,/team/afeld/
alan,Alan,DeLevie,Alan deLevie,/team/alan/
alan-atlas,Alan,Atlas,,/team/alan-atlas/
alan-brouilette,Alan,Brouilette,,/team/alan-brouilette/
alan,Alan,DeLevie,Alan deLevie,/team/alan/
alex-bielen,Alex,Bielen,,
alex-bisker,Alex,Bisker,,/team/alex-bisker/
alex-dalessio,Alex,Dalessio,,
Expand All @@ -34,10 +34,10 @@ amy-ashida,Amy,Ashida,,
amy-mok,Amy,Mok,,
amy-wilson,Amy,Wilson,,
andre,Andre,Francisco,,/team/andre/
andrew,Andrew,Stroup,,/team/andrew/
andrew-burnes,Andrew,Burnes,,
andrew-dunkman,Andrew,Dunkman,,
andrew-hyder,Andrew,Hyder,,
andrew,Andrew,Stroup,,/team/andrew/
andrewmaier,Andrew,Maier,,/team/andrewmaier/
andrewmcmahon,Andrew,McMahon,,
andy-brody,Andy,Brody,,
Expand All @@ -47,15 +47,16 @@ anna,Anna,Sebok,Anna Heller Sebok,/team/anna/
annalee,Annalee,Flower Horne,,/team/annalee/
anne-petersen,Anne,Petersen,,
anthony-garvan,Tony,Garvan,,/team/anthony-garvan/
anthony-garven,Anthony,Garven,,
ashley-owens,Ashley,Owens,,
austin-hernandez,Austin,Hernandez,,
aviva-oskow,Aviva,Oskow,,
ayushi-roy,Ayushi,Roy,,
bateman,Patrick,Bateman,,/team/bateman/
becky,Becky,Sweger,,/team/becky/
ben,Ben,Willman,,/team/ben/
bill-laughman-guest-doj,Bill,Laughman,,
bill,Bill,Rooney,,/team/bill/
bill-laughman-guest-doj,Bill,Laughman,,
blacktm,Tom,Black,,/team/blacktm/
bob-ballance,Bob,Ballance,,
boon-sheridan,Boon,Sheridan,,
Expand All @@ -65,9 +66,9 @@ brandon,Brandon,Kirby,,/team/brandon/
brendan,Brendan,Sudol,,/team/brendan/
bret,Bret,Mogilefsky,,/team/bret/
brethauer,Nick,Brethauer,,/team/brethauer/
brian,Brian,Hedberg,,/team/brian/
brian-burns,Brian,Burns,Brian Burns,
brian-whittaker,Brian,Whittaker,,
brian,Brian,Hedberg,,/team/brian/
britta-gustafson,Britta,Gustafson,,/team/britta-gustafson/
cameron-dixon,Cameron,Dixon,,
carlo-costino,Carlo,Costino,,/team/carlo-costino/
Expand All @@ -78,9 +79,9 @@ catherine,Catherine,Devlin,,/team/catherine/
charlotte-snow,Charlotte,Snow,,
chris-holly,Chris,Holly,,
chrisc,Chris,Cairns,,/team/chrisc/
christine,Christine,Cheung,,/team/christine/
christine-bath,Christine,Bath,,
christine-cawthorne,Christine,Cawthorne,,
christine,Christine,Cheung,,/team/christine/
christopher-goranson,Christopher,Goranson,Chris Goranson,/team/christopher-goranson/
clara-tsao,Clara,Tsao,,
clarice-chan,Clarice,Chan,,
Expand All @@ -93,7 +94,7 @@ cordelia-yu,Cordelia,Yu,,
corey-mahoney,Corey,Mahoney,,/team/corey.mahoney/
cristina,Cristina,Brydges,,/team/cristina/
dahianna,Dahianna,Salazar Foreman,,
Dan O. Williams,Dan O.,Williams,,
dan-williams,Dan,Williams,Dan O. Williams,
david,Dave,Best,,
davida-marion,Davida,Marion,,
deniseroth,Denise,Roth,Denise Turner Roth,
Expand Down Expand Up @@ -138,6 +139,7 @@ igor-korenfeld,Igor,Korenfeld,,
jackie,Jackie,Kazil,,
jackiexu,Jackie,Xu,,/team/jackiexu/
jacklynn-pham,Jacklynn,Pham,Jacklynn Pham,
jacob-kaplan-moss,Jacob,Kaplan-Moss,,
jacobharris,Jacob,Harris,,/team/jacobharris/
james-seppi,James,Seppi,,/team/james-seppi/
jameshupp,James,Hupp,,/team/jameshupp/
Expand All @@ -159,8 +161,8 @@ jerome-lee,Jerome,Lee,,
jessedondero,Jesse,Dondero,,/team/jessedondero/
jessica-dussault,Jessica,Dussault,,
jessica-marine,Jessica,Marine,,
jessie-posilkin,Jessie,Posilkin,,/team/jessie-posilkin/
jessie,Jessie,Young,,/team/jessie/
jessie-posilkin,Jessie,Posilkin,,/team/jessie-posilkin/
jez-humble,Jez,Humble,,/team/jez-humble/
jfinch,Jay,Finch,,/team/jfinch/
jhunter,Jeannine,Hunter,,/team/jhunter/
Expand All @@ -179,17 +181,17 @@ joshcarp,Josh,Carp,,/team/joshcarp/
jtag,Jesse,Taggert,,/team/jtag/
jthibault,Jennifer,Thibault,,/team/jthibault/
jtindel,John,Tindel,,
julia,Julia,Elman,,/team/julia/
julia-allen,Julia,Allen,,/team/julia-allen/
julia-lindpaintner,Julia,Lindpaintner,,
julia,Julia,Elman,,/team/julia/
juliawinn,Julia,Winn,,/team/julia-winn
justin,Justin,Grevich,,/team/justin/
justin-herman,Justin,Herman,,
justin-koufopoulos,Justin,Koufopoulos,,
justin,Justin,Grevich,,/team/justin/
kaitlin,Kaitlin,Devine,,/team/kaitlin/
kane,Kane,Baccigalupi,,/team/kane/
kara-reinsel,Kara,Reinsel,,
kara,Kara,DeFrias,,/team/kara/
kara-reinsel,Kara,Reinsel,,
karim-said,Karim,Said,,
kate,Kate,Garklavs,,/team/kate/
kathrynconnolly,Kathryn,Connolly,,/team/kathrynconnolly/
Expand Down Expand Up @@ -221,13 +223,13 @@ malaika-carpenter,Malaika,Carpenter,,
manger,Noah,Manger,,/team/manger/
marco,Marco,Segreto,,/team/marco/
marinafox,Marina,Fox,,
mark,Mark,Nejbauer,,/team/mark/
mark-headd,Mark,Headd,,
mark-meyer,Mark,Meyer,,
mark-trammell,Mark,Trammell,,
mark,Mark,Nejbauer,,/team/mark/
matt,Matt,Spencer,,/team/matt/
matt-cloyd,Matt,Cloyd,,
matt-dobson,Matt,Dobson,Matt Dobson,
matt,Matt,Spencer,,/team/matt/
mattchessen,Matt,Chessen,"Matt Chessen, Department of State",
maya,Maya,Benari,,/team/maya/
mbland,Mike,Bland,,
Expand Down Expand Up @@ -257,8 +259,8 @@ mollieruskin,Mollie,Ruskin,,
moncef,Moncef,Belyamani,,/team/moncef/
mossadeq-zia,Mossadeq,Zia,,/team/mossadeq-zia/
neil-martinsen-burrell,Neil,Martinsen-Burrell,,
nick-kramer,Nick,Kramer,,
nick,Nick,Bristow,,/team/nick/
nick-kramer,Nick,Kramer,,
nicky-krause,Nicky,Krause,,
nicole-fenton,Nicole,Fenton,,/team/nicole-fenton/
nikki-lee,Nikki,Lee,,
Expand All @@ -271,9 +273,11 @@ ozzy,Ozzy,Johnson,,
peter-burkholder,Peter,Burkholder,,
peter-rowland,Peter,Rowland,,
phaedra,Phaedra,Chrousos,,/team/phaedra/
philip-harding,Philip,Harding,,
phoebe-espiritu,Phoebe,Phoebe,Phoebe Espiritu,/team/phoebe-espiritu/
pia,Pia,Scott,,/team/pia/
pkarman,Peter,Karman,,/team/pkarman/
pkarmen,P,Karmen,,
porta,Porta,Antiporta,,/team/porta-antiporta
princess-ojiaku,Princess,Ojiaku,Princess Ojiaku,
puja,Puja,Balachander,,/team/puja/
Expand All @@ -290,13 +294,13 @@ roger-ruiz,Roger,Ruiz,,/team/roger-ruiz/
romke,Romke,De Haan,,
ron-bronson,Ron,Bronson,,
russ,Russ,Unger,,/team/romke
ryan,Ryan,Thurwell,Ryan Thurlwell,/team/ryan/
ryan-ahearn,Ryan,Ahearn,,
ryan-hofschneider,Ryan,Hofschneider,,
ryan-johnson,Ryan,Johnson,,
ryan-sibley,Ryan,Sibley,,/team/ryan-sibley/
ryan,Ryan,Thurwell,Ryan Thurlwell,/team/ryan/
sarah-eckert,Sarah,Eckert,,
sarah,Sarah,Allen,,
sarah-eckert,Sarah,Eckert,,
sarahcrane,Sarah,Crane,,
sarayu-srinivasan,Sarayu,Srinivasan,,
sasha,Sasha,Magee,,/team/sasha/
Expand All @@ -309,6 +313,7 @@ shawnique,Shawnique,Muller,,/team/shawnique/
smita,Smita,Satiani,,/team/smita/
stacy-dion,Stacy,Dion,,
stephanierivera,Stephanie,Rivera,,/team/stephanierivera/
stephen-harms,Stephen,Harms,,
steven-harms,Steven,Harms,,/team/steven-harms/
steven-reilly,Steven,Reilly,,/team/steven-reilly/
stuart-drown,Stuart,Drown,,
Expand All @@ -320,12 +325,11 @@ timlowden,Tim,Lowden,,
timothy-jones,Timothy,Jones,Tim Jones,/team/timothy-jones/
tom-mills,Tom,Mills,,/team/tom-mills/
uchenna-moka-solana,Uchenna,Moka-Solana,,
unpublished-author,unpublished,author,Unpublished Author,
valdiviezo,Victor,Valdiviezo,,/team/valdiviezo/
vdavez,Dave,Zvenyach,V. David Zvenyach,/team/vdavez/
vicki-mcfadden,Vicki,McFadden,,
victor-udoewa,Victor,Udoewa,,/team/victor-udoewa/
victor,Victor,Zapanta,Victor Diaz Zapanta,/team/victor/
victor-udoewa,Victor,Udoewa,,/team/victor-udoewa/
vraj-mohan,Vraj,Mohan,,/team/vraj-mohan/
waldo-jaquith,Waldo,Jaquith,,
will,Will,Slack,,/team/will/
Expand Down
6 changes: 1 addition & 5 deletions _includes/layouts/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
Layout for author page with their blog posts
{% endcomment %}

<pre>
collections.post size: {{collections.post | size}}
</pre>

{% assign matching_posts = collections.post | limit: 3 %}
{% assign matching_posts = collections.post | matching: author.id | sort: 'date' | limit: 3 %}

<section class="usa-section section-padding-sm">
<div class="grid-container">
Expand Down
7 changes: 5 additions & 2 deletions _includes/layouts/post.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
layout: default
---
{% comment %}
Some of the `page.` references will need to be deleted — but I'm not yet sure which.
{% endcomment %}

{% if page.image %}
{% include "feature-image.html" %}
Expand All @@ -11,9 +14,9 @@
<div class="grid-row">
<div class="tablet:grid-col-12">
<header>
<h1 itemprop="name headline">{{ page.title }}</h1>
<h1 itemprop="name headline">{{ title }}</h1>
<p class="margin-top-3 margin-bottom-0">
{% include "post-authors.html", post: page %}
{% include "post-authors.html", authors: authors %}
</p>
<p class="margin-top-1">
Published on <time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%B %-d, %Y" }}</time>
Expand Down
4 changes: 2 additions & 2 deletions _includes/post-authors.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<span class="post-byline">
{%- assign authorCount = post.data.authors.size -%}
{%- assign authorCount = authors.size -%}
By
{%- for author in post.data.authors -%}
{%- for author in authors -%}
{% include "post-author.html", author: author %}
{%- if authorCount > 1 -%}
{%- unless forloop.last -%}
Expand Down
2 changes: 1 addition & 1 deletion _includes/post-date.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
on <span class="post-date">{{ post.date | date: "%B %-d, %Y" }}</span>
on <span class="post-date">{{ date | date: "%B %-d, %Y" }}</span>
2 changes: 1 addition & 1 deletion _includes/post-excerpt.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>{{ post.data.excerpt }}</p>
<p>{{ excerpt }}</p>
10 changes: 5 additions & 5 deletions _includes/post-preview.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<li class="border-bottom-1px border-base-lighter padding-y-6">
{% include "post-title.html", post: post %}
{% include "post-title.html", title: post.data.title, url: post.url %}
<p>
{% include "post-authors.html", post: post -%}
{%- include "post-date.html", post: post %}
{% include "post-authors.html", authors: post.data.authors -%}
{%- include "post-date.html", date: post.date %}
</p>
{% include "post-excerpt.html", post: post %}
{% include "post-tags.html", post: post %}
{% include "post-excerpt.html", excerpt: post.data.excerpt %}
{% include "post-tags.html", tags: post.tags %}
</li>
2 changes: 1 addition & 1 deletion _includes/post-tags.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<span class="post-tags display-flex flex-wrap" itemprop="keywords">
{% for tag in post.tags %}
{% for tag in tags %}
<a href="{{ site.baseurl }}/{{ site.tag_dir }}/{{ tag | slugify }}/"
class="usa-label post-tag"
>
Expand Down
4 changes: 2 additions & 2 deletions _includes/post-title.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h2>
<a href="{{ post.url | prepend: site.baseurl }}" class="post-link text-no-underline">
{{ post.data.title }}
<a href="{{ url | prepend: site.baseurl }}" class="post-link text-no-underline">
{{ title }}
</a>
</h2>
6 changes: 5 additions & 1 deletion config/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const teamData = parse(
);

const findPerson = (id) => {
return teamData.find((person) => person.id == id);
const maybePerson = teamData.find((person) => person.id == id);
if (maybePerson === undefined) {
console.log(id, "is undefined")
}
return maybePerson
}

const fullName = (person) => {
Expand Down
2 changes: 1 addition & 1 deletion content/posts/2016-03-22-what-was-your-path-to-18f.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ _We help agencies transform into modern, high-functioning organizations through
</blockquote>
</div>

<div class="pquote">{{ "harding" | team_photo }}
<div class="pquote">{{ "philip-harding" | team_photo }}
<blockquote>
“A non-traditional life intertwined with tech entrepreneurship, online startups, interactive design, and public service. Served as youth pastor, founded a brand design firm, scaled a tech training organization, worked on Capitol Hill and was a Resident in the Venture Incubation Program at the Harvard Innovation Lab working on applying fantasy football to the legislative process. After graduating from my master's program at Harvard's Kennedy School, found my way to a place where all the pieces of my life come together.” – Philip Harding
</blockquote>
Expand Down

0 comments on commit dd12521

Please sign in to comment.