Skip to content

Commit 2a887ee

Browse files
markdumayclaude
andcommitted
refactor: improve testimonials component and layout
- Fix variable reference in grid layout ($args.testimonials instead of .testimonials) - Add testimonial-grid class to non-carousel container for consistent styling - Update testimonial partial to handle link parameter correctly - Simplify link handling logic and remove unused url parameter fallback - Update example documentation with link references 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <[email protected]>
1 parent 19575f8 commit 2a887ee

File tree

6 files changed

+63
-59
lines changed

6 files changed

+63
-59
lines changed

component-library/components/testimonials/testimonials.hugo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@
7979
</button>
8080
</div>
8181
{{ else }}
82-
<div class="container p-0">
82+
<div class="testimonial-grid container p-0">
8383
<div class="row {{ $colGrid }} g-3">
84-
{{ range .testimonials }}
84+
{{ range $args.testimonials }}
8585
<div class="col">
8686
{{ partial "assets/testimonial.html" (dict
8787
"page" page

component-library/components/testimonials/testimonials.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121

2222
section.testimonials {
23-
.carousel {
23+
.carousel, .testimonial-grid {
2424
width: 100%;
2525
}
2626

exampleSite/content/en/blocks/testimonials.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@ Set `carousel` to `true` to render a carousel of multiple testimonials.
6060
testimonials:
6161
- icon: fab linkedin
6262
content: First testimonial.
63+
link: /en/about/
6364
- icon: fab google
6465
content: Second testimonial.
66+
link: /en/about/
6567
- icon: fab github
6668
content: Third testimonial.
69+
link: /en/about/
6770
```
6871

6972
{{< /example-bookshop >}}

exampleSite/hugo_stats.json

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"btn-secondary",
132132
"btn-sm",
133133
"btn-social",
134+
"btn-testimonial",
134135
"btn-xs",
135136
"card",
136137
"card-block-2",
@@ -580,6 +581,7 @@
580581
"tag-link",
581582
"team",
582583
"testimonial-carousel-item",
584+
"testimonial-grid",
583585
"testimonial-icon",
584586
"testimonial-img",
585587
"testimonials",
@@ -735,11 +737,11 @@
735737
"docs",
736738
"documentation",
737739
"dropdown-nav-0",
738-
"dropdown-panel-176e79a81804990838b25b5b7db3d707",
739-
"dropdown-panel-2a393f6f0bdf9cf0729b6aac8ecc19f4",
740-
"dropdown-panel-3c757508b637a949db22f85379b36d09",
741-
"dropdown-panel-60874ab8013a46b38bc3a7cbac2bbbfe",
742-
"dropdown-panel-d2b20ed35372229931cb14b436248a49",
740+
"dropdown-panel-24eb1095d52c008b0a371dcbd9991fd9",
741+
"dropdown-panel-45611534504290a4b3d09afa8b8b9c2b",
742+
"dropdown-panel-a376f9d045b3e2101677b9e936a535e1",
743+
"dropdown-panel-fd967038dceaf2412c59c3b29b288f74",
744+
"dropdown-panel-fe0d6d688bb383fe83a0dc3a5ed68e6a",
743745
"eerste-artikel",
744746
"elements-type",
745747
"entity-relationship-diagram",
@@ -762,11 +764,11 @@
762764
"fab-whatsapp",
763765
"fab-x-twitter",
764766
"faq",
765-
"faq-eebe765f3d549a50d1376984dcfacfb1",
766-
"faq-eebe765f3d549a50d1376984dcfacfb1-heading-faq-eebe765f3d549a50d1376984dcfacfb1",
767-
"faq-eebe765f3d549a50d1376984dcfacfb1-item-0",
768-
"faq-eebe765f3d549a50d1376984dcfacfb1-item-1",
769-
"faq-eebe765f3d549a50d1376984dcfacfb1-item-2",
767+
"faq-bff129cfbc7f25b4fd5cd99242271805",
768+
"faq-bff129cfbc7f25b4fd5cd99242271805-heading-faq-bff129cfbc7f25b4fd5cd99242271805",
769+
"faq-bff129cfbc7f25b4fd5cd99242271805-item-0",
770+
"faq-bff129cfbc7f25b4fd5cd99242271805-item-1",
771+
"faq-bff129cfbc7f25b4fd5cd99242271805-item-2",
770772
"fas-1",
771773
"fas-2",
772774
"fas-3",
@@ -884,11 +886,11 @@
884886
"nav-0-btn-1",
885887
"nav-0-btn-2",
886888
"nav-nav-0",
887-
"nav-panel-176e79a81804990838b25b5b7db3d707",
888-
"nav-panel-2a393f6f0bdf9cf0729b6aac8ecc19f4",
889-
"nav-panel-3c757508b637a949db22f85379b36d09",
890-
"nav-panel-60874ab8013a46b38bc3a7cbac2bbbfe",
891-
"nav-panel-d2b20ed35372229931cb14b436248a49",
889+
"nav-panel-24eb1095d52c008b0a371dcbd9991fd9",
890+
"nav-panel-45611534504290a4b3d09afa8b8b9c2b",
891+
"nav-panel-a376f9d045b3e2101677b9e936a535e1",
892+
"nav-panel-fd967038dceaf2412c59c3b29b288f74",
893+
"nav-panel-fe0d6d688bb383fe83a0dc3a5ed68e6a",
892894
"navbar",
893895
"navbar-0-collapse",
894896
"navbar-mode",
@@ -898,36 +900,36 @@
898900
"notification",
899901
"over-mij",
900902
"overview",
901-
"panel-176e79a81804990838b25b5b7db3d707-0",
902-
"panel-176e79a81804990838b25b5b7db3d707-1",
903-
"panel-176e79a81804990838b25b5b7db3d707-2",
904-
"panel-176e79a81804990838b25b5b7db3d707-btn-0",
905-
"panel-176e79a81804990838b25b5b7db3d707-btn-1",
906-
"panel-176e79a81804990838b25b5b7db3d707-btn-2",
907-
"panel-2a393f6f0bdf9cf0729b6aac8ecc19f4-0",
908-
"panel-2a393f6f0bdf9cf0729b6aac8ecc19f4-1",
909-
"panel-2a393f6f0bdf9cf0729b6aac8ecc19f4-2",
910-
"panel-2a393f6f0bdf9cf0729b6aac8ecc19f4-btn-0",
911-
"panel-2a393f6f0bdf9cf0729b6aac8ecc19f4-btn-1",
912-
"panel-2a393f6f0bdf9cf0729b6aac8ecc19f4-btn-2",
913-
"panel-3c757508b637a949db22f85379b36d09-0",
914-
"panel-3c757508b637a949db22f85379b36d09-1",
915-
"panel-3c757508b637a949db22f85379b36d09-2",
916-
"panel-3c757508b637a949db22f85379b36d09-btn-0",
917-
"panel-3c757508b637a949db22f85379b36d09-btn-1",
918-
"panel-3c757508b637a949db22f85379b36d09-btn-2",
919-
"panel-60874ab8013a46b38bc3a7cbac2bbbfe-0",
920-
"panel-60874ab8013a46b38bc3a7cbac2bbbfe-1",
921-
"panel-60874ab8013a46b38bc3a7cbac2bbbfe-2",
922-
"panel-60874ab8013a46b38bc3a7cbac2bbbfe-btn-0",
923-
"panel-60874ab8013a46b38bc3a7cbac2bbbfe-btn-1",
924-
"panel-60874ab8013a46b38bc3a7cbac2bbbfe-btn-2",
925-
"panel-d2b20ed35372229931cb14b436248a49-0",
926-
"panel-d2b20ed35372229931cb14b436248a49-1",
927-
"panel-d2b20ed35372229931cb14b436248a49-2",
928-
"panel-d2b20ed35372229931cb14b436248a49-btn-0",
929-
"panel-d2b20ed35372229931cb14b436248a49-btn-1",
930-
"panel-d2b20ed35372229931cb14b436248a49-btn-2",
903+
"panel-24eb1095d52c008b0a371dcbd9991fd9-0",
904+
"panel-24eb1095d52c008b0a371dcbd9991fd9-1",
905+
"panel-24eb1095d52c008b0a371dcbd9991fd9-2",
906+
"panel-24eb1095d52c008b0a371dcbd9991fd9-btn-0",
907+
"panel-24eb1095d52c008b0a371dcbd9991fd9-btn-1",
908+
"panel-24eb1095d52c008b0a371dcbd9991fd9-btn-2",
909+
"panel-45611534504290a4b3d09afa8b8b9c2b-0",
910+
"panel-45611534504290a4b3d09afa8b8b9c2b-1",
911+
"panel-45611534504290a4b3d09afa8b8b9c2b-2",
912+
"panel-45611534504290a4b3d09afa8b8b9c2b-btn-0",
913+
"panel-45611534504290a4b3d09afa8b8b9c2b-btn-1",
914+
"panel-45611534504290a4b3d09afa8b8b9c2b-btn-2",
915+
"panel-a376f9d045b3e2101677b9e936a535e1-0",
916+
"panel-a376f9d045b3e2101677b9e936a535e1-1",
917+
"panel-a376f9d045b3e2101677b9e936a535e1-2",
918+
"panel-a376f9d045b3e2101677b9e936a535e1-btn-0",
919+
"panel-a376f9d045b3e2101677b9e936a535e1-btn-1",
920+
"panel-a376f9d045b3e2101677b9e936a535e1-btn-2",
921+
"panel-fd967038dceaf2412c59c3b29b288f74-0",
922+
"panel-fd967038dceaf2412c59c3b29b288f74-1",
923+
"panel-fd967038dceaf2412c59c3b29b288f74-2",
924+
"panel-fd967038dceaf2412c59c3b29b288f74-btn-0",
925+
"panel-fd967038dceaf2412c59c3b29b288f74-btn-1",
926+
"panel-fd967038dceaf2412c59c3b29b288f74-btn-2",
927+
"panel-fe0d6d688bb383fe83a0dc3a5ed68e6a-0",
928+
"panel-fe0d6d688bb383fe83a0dc3a5ed68e6a-1",
929+
"panel-fe0d6d688bb383fe83a0dc3a5ed68e6a-2",
930+
"panel-fe0d6d688bb383fe83a0dc3a5ed68e6a-btn-0",
931+
"panel-fe0d6d688bb383fe83a0dc3a5ed68e6a-btn-1",
932+
"panel-fe0d6d688bb383fe83a0dc3a5ed68e6a-btn-2",
931933
"panels",
932934
"persona",
933935
"pie-chart",
@@ -965,7 +967,7 @@
965967
"table",
966968
"tabs",
967969
"team",
968-
"testimonial-carousel-c60d5407dc42e4174a7eb9fc3847330b",
970+
"testimonial-carousel-e9c4bd825854986577faca5bebb5a3ae",
969971
"testimonials",
970972
"testimonials-type",
971973
"third-party-links--use-of-your-information",

hugo_stats.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
"search-modal",
192192
"search-suggestions",
193193
"section-cover",
194+
"section-title",
194195
"svg-inline--fa",
195196
"text-",
196197
"text-body",

layouts/_partials/assets/testimonial.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,18 @@
7373
{{ end }}
7474

7575
<!-- Initialize arguments and default values -->
76-
{{- $url := "" -}}
76+
{{- $link := "" -}}
7777
{{ with $args.link }}
78-
{{ $link := partial "utilities/GetLink.html" (dict "page" page "href" .) }}
79-
{{ if not $link.error }}
80-
{{ $url = $link.destination }}
78+
{{ $href := partial "utilities/GetLink.html" (dict "page" $args.page "href" .) }}
79+
{{ if not $href.error }}
80+
{{ $link = $href.href }}
8181
{{ else }}
8282
{{ with $args.page.File }}
83-
{{ warnf "Error processing link on page '%s': %s" (path.Join "/content" .Path) $link.msg }}
83+
{{ warnf "Error processing link on page '%s': %s" (path.Join "/content" .Path) $href.msg }}
8484
{{ else }}
85-
{{ warnf "Error processing link: %s" $link.msg }}
85+
{{ warnf "Error processing link: %s" $href.msg }}
8686
{{ end }}
8787
{{ end }}
88-
{{ else }}
89-
{{ $url = $args.url }}
9088
{{ end }}
9189

9290
{{/* Main code */}}
@@ -101,8 +99,8 @@
10199
"role" $args.role
102100
"image" $args.image
103101
"padding" $args.padding
104-
"url" $url
105-
"link" $url
102+
"url" $args.url
103+
"link" $link
106104
}}
107105

108106
{{ if $args.showControls }}

0 commit comments

Comments
 (0)