From ee958dbbcb42dfbdded4073a92a257707c8223fa Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 5 Oct 2023 18:26:21 -0700 Subject: [PATCH] Use new plugin to format pricing --- _plugins/number_format_filter.rb | 19 +++++++++++++++++++ _vendors/airtable.yaml | 2 +- _vendors/intercom.yaml | 2 +- index.md | 6 +++--- 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 _plugins/number_format_filter.rb diff --git a/_plugins/number_format_filter.rb b/_plugins/number_format_filter.rb new file mode 100644 index 00000000..ca2d3f41 --- /dev/null +++ b/_plugins/number_format_filter.rb @@ -0,0 +1,19 @@ +module Jekyll + module NumberFormatFilter + def format(input, currency) + currency_symbol = case currency + when "USD" + "$" + when "EUR" + "€" + else + "" + end + + + "#{currency_symbol}#{input}" + end + end +end + +Liquid::Template.register_filter(Jekyll::NumberFormatFilter) \ No newline at end of file diff --git a/_vendors/airtable.yaml b/_vendors/airtable.yaml index 59e6fe41..1d50dab6 100644 --- a/_vendors/airtable.yaml +++ b/_vendors/airtable.yaml @@ -1,6 +1,6 @@ --- base_pricing: 10 -currency: $ +currency: USD notes: $60 per user per month, minimum of $3000 per month. name: Airtable pricing_sources: diff --git a/_vendors/intercom.yaml b/_vendors/intercom.yaml index 48125286..12cdee83 100644 --- a/_vendors/intercom.yaml +++ b/_vendors/intercom.yaml @@ -1,6 +1,6 @@ --- base_pricing: 136 -currency: $ +currency: USD name: Intercom pricing_sources: - https://twitter.com/brianebeyer/status/1053797786301489153 diff --git a/index.md b/index.md index 3cddf0f9..9c6c7417 100644 --- a/index.md +++ b/index.md @@ -25,7 +25,7 @@ If companies claim to "take your security seriously", then SSO should be availab Many vendors charge 2x, 3x, or 4x the base product pricing for access to SSO, which disincentivizes its use and encourages poor security practices. -{% assign all = site.vendors | where: "currency", "$" | sort: "name" %} +{% assign all = site.vendors | where: "currency", "USD" | sort: "name" %} {% assign vendors = "" | split: ',' %} {% assign call_us = "" | split: ',' %} {% for vendor in all %} @@ -55,8 +55,8 @@ Many vendors charge 2x, 3x, or 4x the base product pricing for access to SSO, wh {% for vendor in vendors %} {{ vendor.name }} -{{ vendor.currency }}{{ vendor.base_pricing }} -{{ vendor.currency }}{{ vendor.sso_pricing }} +{{ vendor.base_pricing | format: vendor.currency }} +{{ vendor.sso_pricing | format: vendor.currency}} {{ vendor.pricing_scheme }} {{ vendor.sso_pricing | minus: vendor.base_pricing | times: 1.0 | divided_by: vendor.base_pricing | times: 100 | round }}% {{ vendor.notes | truncate: 50 }}