From bd0dbfa7bc65af54e6b5b36e6ecbc411504ddae2 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 10 Jan 2024 07:11:57 +0000 Subject: [PATCH] Make years of experience dynamic based on the ...current year --- app/config/sculpin_site.yml | 1 - source/_includes/about-me.html.twig | 4 +++- source/_includes/macros.html.twig | 3 +++ source/_pages/call.html.twig | 6 ++++-- source/_pages/drupal-upgrade.md | 4 +++- source/_pages/index.md | 4 +++- source/_pages/pair.html.twig | 4 +++- source/_pages/press.md | 4 +++- source/_pages/speaker.md | 4 +++- source/_pages/team-coaching.html.twig | 4 +++- 10 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 source/_includes/macros.html.twig diff --git a/app/config/sculpin_site.yml b/app/config/sculpin_site.yml index d7731d1b5..d6b3e6c59 100644 --- a/app/config/sculpin_site.yml +++ b/app/config/sculpin_site.yml @@ -2,7 +2,6 @@ name: Oliver Davies slogan: Certified Drupal expert, Developer and Consultant email: oliver+website@oliverdavies.uk -yearsExperience: 16 assets_version: 3 meta: diff --git a/source/_includes/about-me.html.twig b/source/_includes/about-me.html.twig index 447c2daf3..823b4bfd0 100644 --- a/source/_includes/about-me.html.twig +++ b/source/_includes/about-me.html.twig @@ -1,3 +1,5 @@ +{% import 'macros' as macros %} +

About me

@@ -8,7 +10,7 @@
-

I'm an Acquia-certified Drupal Triple Expert with {{ site.yearsExperience }} years of experience, an open-source software maintainer and Drupal core contributor, public speaker, and host of the Beyond Blocks podcast.

+

I'm an Acquia-certified Drupal Triple Expert with {{ macros.yearsExperience }} years of experience, an open-source software maintainer and Drupal core contributor, public speaker, and host of the Beyond Blocks podcast.

diff --git a/source/_includes/macros.html.twig b/source/_includes/macros.html.twig new file mode 100644 index 000000000..b532d0987 --- /dev/null +++ b/source/_includes/macros.html.twig @@ -0,0 +1,3 @@ +{% macro yearsExperience() %} + {{- today|date('Y') - 2007 -}} +{% endmacro %} diff --git a/source/_pages/call.html.twig b/source/_pages/call.html.twig index c3e3e6a4b..1d6bead7f 100644 --- a/source/_pages/call.html.twig +++ b/source/_pages/call.html.twig @@ -26,6 +26,8 @@ faqs: {% block content %} +{% import 'macros' as macros %} + {#

Who is this for?

#} {# Pain #} @@ -34,7 +36,7 @@ faqs: {# Fix #} -

As a professional Software Developer and Consultant with over {{ site.yearsExperience }} years of Drupal and PHP experience, I have a lot of knowledge that I use to help customers and their projects.

+

As a professional Software Developer and Consultant with {{ macros.yearsExperience }} years of Drupal and PHP experience, I have a lot of knowledge that I use to help customers and their projects.

Some things I can help you with

@@ -84,7 +86,7 @@ faqs:

Who am I?