diff --git a/component-library/components/cta/cta.hugo.html b/component-library/components/cta/cta.hugo.html index 88a71f7..62af951 100644 --- a/component-library/components/cta/cta.hugo.html +++ b/component-library/components/cta/cta.hugo.html @@ -10,12 +10,13 @@ */}} {{/* Main code */}} +{{- $ctaAction := site.Params.icons.ctaAction | default "fas chevron-right" -}} {{ $links := slice }} {{ if and (reflect.IsSlice .links) (gt (len .links) 0) }} {{ $links = .links }} {{ else }} {{ with site.Params.modules.bookshop.cta.defaultURL }} - {{ $links = $links | append (dict "title" (T "contactAction") "url" . "icon" "fas chevron-right") }} + {{ $links = $links | append (dict "title" (T "contactAction") "url" . "icon" $ctaAction) }} {{ end }} {{ end }} diff --git a/config.toml b/config.toml index 6d1da60..054e910 100644 --- a/config.toml +++ b/config.toml @@ -51,6 +51,19 @@ [[module.imports]] path = "github.com/cloudcannon/bookshop/hugo/v3" +# Icon defaults for mod-blocks components +[params.icons] + # Testimonial carousel controls + carouselPrev = "fas chevron-left" + carouselNext = "fas chevron-right" + # CTA and contact action links + ctaAction = "fas chevron-right" + # Preview component device tabs and error state + previewDesktop = "fas fa-desktop" + previewTablet = "fas fa-tablet-alt" + previewMobile = "fas fa-mobile-alt" + previewError = "fas fa-exclamation-triangle" + # Bookshop module configuration # These defaults are used by mod-blocks components [params.modules.bookshop] diff --git a/layouts/partials/assets/preview.html b/layouts/partials/assets/preview.html index 9cdd863..3f1c080 100644 --- a/layouts/partials/assets/preview.html +++ b/layouts/partials/assets/preview.html @@ -21,6 +21,12 @@ {{/* Initialize global variables */}} {{- $padding := partial "utilities/GetPadding.html" -}} +{{- $deviceIcons := dict + "desktop" (site.Params.icons.previewDesktop | default "fas fa-desktop") + "tablet" (site.Params.icons.previewTablet | default "fas fa-tablet-alt") + "mobile" (site.Params.icons.previewMobile | default "fas fa-mobile-alt") +-}} +{{- $previewError := site.Params.icons.previewError | default "fas fa-exclamation-triangle" -}} {{/* Initialize local variables */}} {{- $devices := slice "desktop" "tablet" "mobile" -}} @@ -41,7 +47,6 @@