From da762239ff38756b5dce9615aa645d0656534d95 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 12 Sep 2023 07:53:58 +0100 Subject: [PATCH] chore(pricing): add Drupal testing email course --- src/pages/pricing.mdx | 8 ++++++-- src/products.json | 8 ++++++++ tools/scripts/create-daily.sh | 6 +++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/pages/pricing.mdx b/src/pages/pricing.mdx index c300ad8e..1b7b1721 100644 --- a/src/pages/pricing.mdx +++ b/src/pages/pricing.mdx @@ -17,8 +17,12 @@ export const priceFormatter = new Intl.NumberFormat('en-GB', { {products && products.map(product => (

- {product.title} - {priceFormatter.format(product.price)} - {product.perMonth && (<> per month)} + {product.title} + {product.price && ( + <> - {priceFormatter.format(product.price)} + {product.perMonth && (<> per month)} + + )}

{product.description}
diff --git a/src/products.json b/src/products.json index 6fa9bae0..57fc2749 100644 --- a/src/products.json +++ b/src/products.json @@ -44,5 +44,13 @@ "text": "Book your session now", "href": "/pair" } + }, + { + "title": "Introduction to automated testing in Drupal - 7-day email course", + "description": "Register for my free upcoming email course on automated testing in Drupal.", + "link": { + "text": "Register now", + "href": "https://forms.gle/9fGwMgaWcWjNDjdAA" + } } ] diff --git a/tools/scripts/create-daily.sh b/tools/scripts/create-daily.sh index b173f86a..59442615 100755 --- a/tools/scripts/create-daily.sh +++ b/tools/scripts/create-daily.sh @@ -14,7 +14,11 @@ shift 1 # Generate the title and slug. title="${*}" -slug=$(echo "${title}" | awk '{print tolower($0)}' | tr ' ' '-' | awk '{ gsub("?", ""); print }') +slug=$(echo "${title}" | \ + tr '[:upper:]' '[:lower:]' | \ + sed 's/[^a-z0-9]/-/g' | \ + sed 's/\-\-+/-/g' | \ + sed 's/^\-//;s/\-$//') # Create the file. cp -f --no-clobber stub.md "${filepath}"