mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 14:14:48 +00:00
fix(blox): resolve template syntax errors in cta-image-paragraph
- Fix malformed if/else block causing "undefined variable $title"
- Add missing closing div tags to correct HTML generation
- Remove orphaned {{ end }} tag preventing proper parsing
This commit is contained in:
1 parent
af716f0c18
commit
2754d1590f
1 file changed
+2
-1
@@ -87,13 +87,14 @@
|
||||
height="{{$image_to_render.Height}}"
|
||||
alt="{{$title | plainify}}" {{ if (modBool $idx 2)}}style="order: 1"{{end}}>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ else if $image_url }}
|
||||
<div class="gap-8 items-center py-8 px-4 mx-auto max-w-screen-xl xl:gap-16 md:grid md:grid-cols-2 sm:py-16 lg:px-6">
|
||||
{{ $is_external := or (strings.HasPrefix $image_url "http://") (strings.HasPrefix $image_url "https://") }}
|
||||
<img class="w-full"
|
||||
src="{{ if $is_external }}{{ $image_url }}{{ else }}{{ $image_url | relURL }}{{ end }}"
|
||||
alt="{{$title | plainify}}" {{ if (modBool $idx 2)}}style="order: 1"{{end}}>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ else }}
|
||||
{{ warnf "%s uses the `cta-image-paragraph` blox which specifies a non-existent `image` at `assets/%s`. Skipping this item." $page.File.Path $image_path }}
|
||||
{{ end }}
|
||||
|
||||
Reference in new issue
Block a user