Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zwbetz-gh/vanilla-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Betz <zwbetz@gmail.com>2018-12-28 06:39:07 +0300
committerZachary Betz <zwbetz@gmail.com>2018-12-28 06:39:07 +0300
commit5300dd9f0effb9cb08c18ebd3e360bf16d4ced97 (patch)
treef218146e6bb042297f7aa46fdd0d8c7cabbd0c9f /layouts
parentc39409dc7e07b9bc0e141c29a6a2a4aff181bbce (diff)
Only show card body when title or text populated
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/bootstrap-card.html16
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