From fc3e30edddb799188c35c66fd7469c78407226f2 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 15 Jan 2024 17:39:59 +0000 Subject: [PATCH] Load testimonials by tag instead of by name - Allow loading testimonials by tag instead of name. - Remove the code to load testimonials by name. - Add a `limit` and `offset` to create different lists on the same page - e.g. on the team coaching page where I have two testimonial sections. --- app/config/sculpin_site.yml | 25 +++++++++++++++++- source/_includes/testimonials.html.twig | 35 +++++++------------------ source/_pages/atdc.md | 9 +------ source/_pages/call.html.twig | 8 +----- source/_pages/daily.md | 9 +------ source/_pages/dto.md | 4 +-- source/_pages/index.md | 4 +-- source/_pages/subscription.md | 18 +------------ source/_pages/team-coaching.html.twig | 12 +++++---- 9 files changed, 46 insertions(+), 78 deletions(-) diff --git a/app/config/sculpin_site.yml b/app/config/sculpin_site.yml index 812d2ebcd..eecb80263 100644 --- a/app/config/sculpin_site.yml +++ b/app/config/sculpin_site.yml @@ -40,6 +40,7 @@ testimonials: url: https://matthieuscarset.com image: url: '%site.assets_url%/assets/images/recommendations/matthieu-scarset.jpg' + tags: [testing] - text: | Hi Oliver, we met briefly at the Tech Connect event in London last month. Been reading through a few of your latest posts and have found the messages valuable, especially as we spent the week learning about unit, integration and e2e testing. I have signed up to your mailing list to keep the good advice flowing! @@ -47,6 +48,7 @@ testimonials: title: Full Stack Software Engineer at School of Code image: url: '%site.assets_url%/assets/images/recommendations/alexander-carr.jpg' + tags: [daily] - text: | These emails are superb and make for very interesting reading. Thank you! @@ -54,6 +56,7 @@ testimonials: title: Drupal Engineer image: url: '%site.assets_url%/assets/images/recommendations/adam-nuttall.jpg' + tags: [daily] - text: Oliver's approach to testing is a continual reminder of his commitment to delivering high-quality, bug-free, software. @@ -61,6 +64,7 @@ testimonials: title: Senior Software Engineer image: url: '%site.assets_url%/assets/images/recommendations/mike-karthauser.jpg' + tags: [daily, testing, coaching] - text: | I had the opportunity and good fortune to work with Oliver solving two problems that I was having on a Drupal Commerce site. I have done several Drupal sites using UberCart, but since it is deprecated, I chose to use Commerce. I had searched, posted to forums, and other normal means to find answers to my problems, to no response and to no avail. @@ -73,6 +77,7 @@ testimonials: name: Tom Evans title: ~ image: ~ + tags: [call] - text: | I am a big fan of your git approaches. I especially remember pairing with you and watching how many commands you run to solve many problems and how fast you were. It's a skill I believe not many have, particularly those who are used to working with a GUI like me, and personally I think it is quite valuable. @@ -80,6 +85,7 @@ testimonials: title: Senior Software Engineer image: url: '%site.assets_url%/assets/images/recommendations/marcos-duran.jpg' + tags: [git, daily, coaching] - text: | I like the "$ git log -S" and "$ git log --grep" commands, will definitely be using these, thanks! @@ -87,6 +93,7 @@ testimonials: title: Solutions Architect image: url: '%site.assets_url%/assets/images/recommendations/stephen-mulvihill.jpg' + tags: [git, daily, coaching] - text: | Just wanted to say that your blog is amazing <3 I absolutely love it and usually share it with colleagues and some of the kids at my Code Club. @@ -96,6 +103,7 @@ testimonials: title: Tech Lead image: url: '%site.assets_url%/assets/images/recommendations/patty-ocallaghan.jpg' + tags: [daily] - text: | I've wanted to explore testing for a while, but as a PHP developer with 10 years of Drupal experience who'd written next to no tests, I really needed guidance. Oliver's expertise in testing and TDD motivated me to seek his help. @@ -110,6 +118,7 @@ testimonials: url: https://www.playingwithpixels.co.uk image: url: '%site.assets_url%/assets/images/recommendations/tawny.jpg' + tags: [testing, coaching] - text: | I've worked with Oliver for a number of years on B2C and B2B web projects and he has always demonstrated himself to be an expert in his field. @@ -122,6 +131,7 @@ testimonials: url: https://www.bastioninsurance.co.uk image: url: '%site.assets_url%/assets/images/recommendations/joe-howell.jpg' + tags: [subscription, coaching] - text: | We use Oliver for maintaining a couple of Drupal sites for which we no longer have the skills ourselves. We became aware of Oliver through his work in the Drupal community, and about a year ago we approached him to help us with the deep dive aspects of maintaining and developing Drupal sites. He's been really helpful and very responsive. Much appreciated! @@ -130,6 +140,7 @@ testimonials: url: https://bristol.ac.uk image: url: '%site.assets_url%/assets/images/recommendations/jon-hallett.jpeg' + tags: [subscription] - text: | For over a decade we have worked with Oliver on a number of different projects. Initially our collaboration consisted of web maintenance and troubleshooting but we soon tapped Oliver to design, build and maintain a custom awards site which includes both submission and judging functionality. Oliver has deep and wide-ranging skills and I would certainly recommend his services! @@ -138,6 +149,7 @@ testimonials: url: https://www.daylightbooks.org image: url: '%site.assets_url%/assets/images/recommendations/michael-itkoff.jpg' + tags: [subscription] - text: | Working with Oliver on the Seren website has been easy and beneficial. @@ -154,6 +166,7 @@ testimonials: url: https://www.serenbooks.com image: url: '%site.assets_url%/assets/images/recommendations/mick-felton.jpg' + tags: [subscription, coaching] - text: | Oliver is a pleasure to work with, and I would engage him again without hesitation. He communicates regularly, ensures that he meets requirements, and suggests improvements to the potential solutions to the brief. @@ -162,6 +175,7 @@ testimonials: url: https://rohallion.agency image: url: '%site.assets_url%/assets/images/recommendations/duncan.jpeg' + tags: [subscription, coaching] - text: | A fantastic and highly knowledgeable Drupal Developer. Oliver saved a struggling Drupal project with his wealth of Drupal experience. @@ -170,6 +184,7 @@ testimonials: url: ~ image: url: '%site.assets_url%/assets/images/recommendations/adam.jpeg' + tags: [subscription] - text: | I had the pleasure of working with Oliver whilst building the first version of our drupal based intranet. His knowledge of Drupal and the wider infrastructure required to run a site was really invaluable. @@ -182,6 +197,7 @@ testimonials: url: https://admiral.com image: url: '%site.assets_url%/assets/images/recommendations/huw.jpeg' + tags: [subscription] - text: | Oliver really knows his stuff. Whether you are just starting out or looking to take your knowledge to the next level, his patient and clear way of explaining will help get you there. @@ -190,6 +206,7 @@ testimonials: url: ~ image: url: '%site.assets_url%/assets/images/recommendations/scott-euser.jpg' + tags: [testing, coaching] - text: | Oliver was great to work with. He has expert knowledge with Drupal and delivered exactly what we were looking for on time. He's understanding, friendly and easy to get along with. I would enjoy working with him again in the future. @@ -197,6 +214,7 @@ testimonials: title: Interactive Creative Director url: ~ image: ~ + tags: [subscription] - text: | I have had the pleasure of working with Oliver on several projects at Microserve. He is a natural innovator and a great mentor who inspires others to explore new technologies and approaches. He is a highly knowledgeable professional with a passion for all things Drupal and the tenacity required to get the job done well. @@ -205,6 +223,7 @@ testimonials: url: ~ image: url: '%site.assets_url%/assets/images/recommendations/alan.jpeg' + tags: [coaching] - text: | Oliver has been an outstanding contributor to the Drupal Association team. He is a talented developer who writes great code and applies his curiosity and love of learning to every project. He is also a fantastic team member, who gives to the team as much as he gets. @@ -215,7 +234,7 @@ testimonials: url: https://www.drupal.org/association image: url: '%site.assets_url%/assets/images/recommendations/holly-ross.png' - + tags: [subscription] - text: | Oliver is a skilled Drupal developer with a passion for the Drupal community. As his direct supervisor, I was able to watch Oliver grow with the Drupal Association and contribute an amazing amount of effort and integrity to all of his work. @@ -226,6 +245,7 @@ testimonials: url: https://joshuami.com image: url: '%site.assets_url%/assets/images/recommendations/josh-mitchell.png' + tags: [subscription] - text: | Oliver was fantastic to work with - pro-active and highly responsive, he worked well remotely and as part of a project team. His understanding of the project requirement(s) and ability to translate it into working code was essential and he delivered. @@ -234,6 +254,7 @@ testimonials: url: ~ image: url: '%site.assets_url%/assets/images/recommendations/brian-healy.png' + tags: [subscription] - text: | Oliver is an amazing colleague, he's professional, full of knowledge and I could not recommend him more. @@ -247,6 +268,7 @@ testimonials: Oliver is seasoned Drupal and all round highly skilled and experienced web developer. I have worked with Oliver on an important project where he was reliable, prompt and ensured strict client deadline delivery and confidentiality at all times. name: Daniel Easterbrook title: Digital Strategy Consultant + tags: [subscription] - text: | We have only worked together for a short while but I can see Oliver is a Drupal expert. @@ -256,4 +278,5 @@ testimonials: If we have complex issues to contend with in the future I feel confident he will be able to deal with them. name: Anonymous title: Marketing Strategist + tags: [subscription] url: http://localhost:8000 diff --git a/source/_includes/testimonials.html.twig b/source/_includes/testimonials.html.twig index cf45ba21b..5f16b46a6 100644 --- a/source/_includes/testimonials.html.twig +++ b/source/_includes/testimonials.html.twig @@ -1,36 +1,19 @@ -{% set defaultNames = [ - "Matthieu Scarset", - "Mike Karthauser", - "Tawny Bartlett", - "Joe Howell", - "Jon Hallett", - "Michael Itkoff", - "Mick Felton", - "Duncan Davidson", - "Adam Cuddihy", - "Huw Davies", - "Scott Euser", - "Brian Hartwell", - "Alan Hatch", - "Holly Ross", - "Josh Mitchell", - "Brian Healy", - "Chris Jarvis", - "Daniel Easterbrook", - "Anonymous", -] %} +{% set limit = limit ?? 10 %} +{% set offset = offset ?? 0 %} -{% if not merge %} - {% set names = names|default(defaultNames) %} -{% else %} - {% set names = names|merge(defaultNames) %} + +{% set testimonials = site.testimonials %} +{% if tag is not null %} + {% set testimonials = testimonials|filter(testimonial => tag in testimonial.tags) %} {% endif %} +{% set testimonials = testimonials|slice(offset, limit) %} +

{{ title|default('Testimonials') }}

- {% for testimonial in site.testimonials|filter(testimonial => names is null or testimonial.name in names) %} + {% for testimonial in testimonials %}
diff --git a/source/_pages/atdc.md b/source/_pages/atdc.md index b14e8e2fe..61828fa28 100644 --- a/source/_pages/atdc.md +++ b/source/_pages/atdc.md @@ -20,14 +20,7 @@ Learn to test things like: {% block content_bottom %}
- {% include 'testimonials.html.twig' with { - names: [ - "Matthieu Scarset", - "Mike Karthauser", - "Tawny Bartlett", - "Scott Euser", - ] - } %} + {% include 'testimonials' with { tag: 'subscription' } %} {{ parent() }}
diff --git a/source/_pages/call.html.twig b/source/_pages/call.html.twig index 1d6bead7f..df6c9cb51 100644 --- a/source/_pages/call.html.twig +++ b/source/_pages/call.html.twig @@ -2,10 +2,6 @@ title: Book a 1-on-1 consulting call link: https://savvycal.com/opdavies/consulting-call price: 350 -testimonials: - - Tawny Bartlett - - Tom Evans - - Michael Itkoff faqs: - - What happens after I pay? @@ -62,9 +58,7 @@ faqs: {# Social proof #} -{% include 'testimonials' with { - names: page.testimonials, -} %} +{% include 'testimonials' with { tag: 'call' } %} {# Overcome objections #} diff --git a/source/_pages/daily.md b/source/_pages/daily.md index 6b3a7039e..9246cd982 100644 --- a/source/_pages/daily.md +++ b/source/_pages/daily.md @@ -10,14 +10,7 @@ title: Register for daily software development emails {% block content_bottom %} {% include 'testimonials.html.twig' with { - names: [ - 'Alexander Carr', - 'Adam Nuttall', - 'Mike Karthauser', - 'Marcos Duran', - 'Stephen Mulvihill', - 'Patty O\'Callaghan', - ], + tag: 'daily', title: 'What subscribers have said', } %} diff --git a/source/_pages/dto.md b/source/_pages/dto.md index 4e6c4c43c..9c0fd19d7 100644 --- a/source/_pages/dto.md +++ b/source/_pages/dto.md @@ -45,6 +45,4 @@ Seats are available at {{ page.is_early_bird ? 'an early
-{% include 'testimonials.html.twig' with { - names: page.testimonials, -} %} +{% include 'testimonials' with { tag: 'testing' } %} diff --git a/source/_pages/index.md b/source/_pages/index.md index 4eea04ec3..4e46734b0 100644 --- a/source/_pages/index.md +++ b/source/_pages/index.md @@ -31,10 +31,8 @@ Here are [all my products and services][pricing]. If you still can't find what y {% endblock %} {% block content_bottom %} - {% include 'testimonials.html.twig' with { + {% include 'testimonials' with { title: 'Kind words from clients, subscribers, and past colleagues', - merge: true, - names: ["Matthieu Scarset"], } %} {% include 'daily-email-form.html.twig' with { diff --git a/source/_pages/subscription.md b/source/_pages/subscription.md index 26f5c37d6..21747f21b 100644 --- a/source/_pages/subscription.md +++ b/source/_pages/subscription.md @@ -182,23 +182,7 @@ And we'll figure out what's best for you. --- -{% include 'testimonials.html.twig' with { - names: [ - 'Joe Howell', - 'Jon Hallett', - 'Michael Itkoff', - 'Mick Felton', - 'Duncan Davidson', - 'Adam Cuddihy', - 'Huw Davies', - 'Brian Hartwell', - 'Holly Ross', - 'Josh Mitchell', - 'Brian Healy', - 'Daniel Easterbrook', - 'Anonymous', - ], -} %} +{% include 'testimonials' with { tag: 'subscription' } %} {% endblock %} diff --git a/source/_pages/team-coaching.html.twig b/source/_pages/team-coaching.html.twig index fdae26a09..0242098ed 100644 --- a/source/_pages/team-coaching.html.twig +++ b/source/_pages/team-coaching.html.twig @@ -88,9 +88,10 @@ meta:

If you need lighter-touch guidance and advice, I also offer one-time consulting calls and pair programming sessions.

- {% include 'testimonials.html.twig' with { - names: ['Mike Karthauser', 'Tawny Bartlett', 'Joe Howell', 'Scott Euser', 'Mick Felton'], - title: 'More that others have said', + {% include 'testimonials' with { + tag: 'coaching', + limit: 5, + title: 'What others have said', } %} {# Uniqueness #} @@ -130,8 +131,9 @@ meta: } %} - {% include 'testimonials.html.twig' with { - names: ['Duncan Davidson', 'Adam Cuddihy', 'Alan Hatch', 'Anonymous'], + {% include 'testimonials' with { + tag: 'coaching', + offset: 5, title: 'More that others have said', } %}