From dd125211fd8256ee386125f4b5a61b55f3f91717 Mon Sep 17 00:00:00 2001 From: Matt J Cloyd Date: Mon, 3 Jun 2024 17:15:22 -0400 Subject: [PATCH] This commit: - 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. --- .eleventy.js | 5 +++ _data/team_members.csv | 42 ++++++++++--------- _includes/layouts/author.html | 6 +-- _includes/layouts/post.html | 7 +++- _includes/post-authors.html | 4 +- _includes/post-date.html | 2 +- _includes/post-excerpt.html | 2 +- _includes/post-preview.html | 10 ++--- _includes/post-tags.html | 2 +- _includes/post-title.html | 4 +- config/filters.js | 6 ++- .../2016-03-22-what-was-your-path-to-18f.md | 2 +- 12 files changed, 52 insertions(+), 40 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 6c4bf339b..d2300fb39 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -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); diff --git a/_data/team_members.csv b/_data/team_members.csv index 723f223d3..8b6a8267b 100644 --- a/_data/team_members.csv +++ b/_data/team_members.csv @@ -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,, @@ -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,, @@ -47,6 +47,7 @@ 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,, @@ -54,8 +55,8 @@ 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,, @@ -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/ @@ -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,, @@ -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, @@ -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/ @@ -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/ @@ -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/ @@ -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,, @@ -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,, @@ -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/ @@ -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/ @@ -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,, @@ -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/ diff --git a/_includes/layouts/author.html b/_includes/layouts/author.html index 687690fad..57e3279f6 100644 --- a/_includes/layouts/author.html +++ b/_includes/layouts/author.html @@ -8,11 +8,7 @@ Layout for author page with their blog posts {% endcomment %} -
-  collections.post size: {{collections.post | size}}
-
- -{% assign matching_posts = collections.post | limit: 3 %} +{% assign matching_posts = collections.post | matching: author.id | sort: 'date' | limit: 3 %}
diff --git a/_includes/layouts/post.html b/_includes/layouts/post.html index 0991c618c..9a73e263a 100644 --- a/_includes/layouts/post.html +++ b/_includes/layouts/post.html @@ -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" %} @@ -11,9 +14,9 @@
-

{{ page.title }}

+

{{ title }}

- {% include "post-authors.html", post: page %} + {% include "post-authors.html", authors: authors %}

Published on diff --git a/_includes/post-authors.html b/_includes/post-authors.html index a26567f79..b59febe07 100644 --- a/_includes/post-authors.html +++ b/_includes/post-authors.html @@ -1,7 +1,7 @@

{{ post.data.excerpt }}

+

{{ excerpt }}

diff --git a/_includes/post-preview.html b/_includes/post-preview.html index e717266b6..a868c8f8b 100644 --- a/_includes/post-preview.html +++ b/_includes/post-preview.html @@ -1,9 +1,9 @@
  • - {% include "post-title.html", post: post %} + {% include "post-title.html", title: post.data.title, url: post.url %}

    - {% 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 %}

    - {% 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 %}
  • diff --git a/_includes/post-tags.html b/_includes/post-tags.html index b83603655..a4486970e 100644 --- a/_includes/post-tags.html +++ b/_includes/post-tags.html @@ -1,5 +1,5 @@
    -
    {{ "harding" | team_photo }} +
    {{ "philip-harding" | team_photo }}
    “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