From 0b8d7147d6a5810358fd08d93ea2ccc960df0cb2 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 15 Jan 2024 18:10:58 +0000 Subject: [PATCH] Add Testimonials page --- source/_includes/testimonials.html.twig | 6 ++++-- source/_pages/testimonials.md | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 source/_pages/testimonials.md diff --git a/source/_includes/testimonials.html.twig b/source/_includes/testimonials.html.twig index 5f16b46a6..1caa489dd 100644 --- a/source/_includes/testimonials.html.twig +++ b/source/_includes/testimonials.html.twig @@ -1,13 +1,15 @@ {% set limit = limit ?? 10 %} {% set offset = offset ?? 0 %} - {% 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) %} +{% if limit > 0 %} + {% set testimonials = testimonials|slice(offset, limit) %} +{% endif %}

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

diff --git a/source/_pages/testimonials.md b/source/_pages/testimonials.md new file mode 100644 index 000000000..7ab472f30 --- /dev/null +++ b/source/_pages/testimonials.md @@ -0,0 +1,8 @@ +--- +title: Testimonials +--- + +{% include 'testimonials' with { + limit: 0, + title: 'All Testimonials', +} %}