diff options
author | Zachary Betz <zwbetz@gmail.com> | 2018-12-28 06:39:07 +0300 |
---|---|---|
committer | Zachary Betz <zwbetz@gmail.com> | 2018-12-28 06:39:07 +0300 |
commit | 5300dd9f0effb9cb08c18ebd3e360bf16d4ced97 (patch) | |
tree | f218146e6bb042297f7aa46fdd0d8c7cabbd0c9f /layouts | |
parent | c39409dc7e07b9bc0e141c29a6a2a4aff181bbce (diff) |
Only show card body when title or text populated
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/shortcodes/bootstrap-card.html | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/layouts/shortcodes/bootstrap-card.html b/layouts/shortcodes/bootstrap-card.html index b8f77a8..2551a95 100644 --- a/layouts/shortcodes/bootstrap-card.html +++ b/layouts/shortcodes/bootstrap-card.html @@ -15,12 +15,14 @@ <a href="{{ $original.Permalink }}"> <img src="{{ $new.Permalink }}" class="card-img-top" alt="{{ .Get "alt" }}"> </a> - <div class="card-body"> - {{ with (.Get "title") }} - <h5 class="card-title">{{ . | markdownify }}</h5> + {{ if or (.Get "title") (.Get "text") }} + <div class="card-body"> + {{ with (.Get "title") }} + <h5 class="card-title">{{ . | markdownify }}</h5> + {{ end }} + {{ with (.Get "text") }} + <p class="card-text">{{ . | markdownify }}</p> + {{ end }} + </div> {{ end }} - {{ with (.Get "text") }} - <p class="card-text">{{ . | markdownify }}</p> - {{ end }} - </div> </div>
\ No newline at end of file |