layouts/shortcodes/cards.html (24 lines of code) (raw):

{{/* Simple card row Input is the name of a page param, which should be a list of card info. Card info is a map with a `title` and `desc`, both of which can contain markdown. */ -}} {{ $card_info := index .Page.Params (.Get 0) -}} {{ $styling := (.Get 1) | default "mt-4 mb-4" -}} <div class="row justify-content-center {{ $styling }}"> {{ range $card_info -}} <div class="col-9 col-lg-4 pb-4 pb-lg-0"> <div class="h-100 card shadow"> <div class="card-body"> <div class="h4 card-title"> {{/* The blank line above ensures the following is processed as markdown */}} {{ .title | safeHTML }} </div> {{/* The blank line above ensures the following is processed as markdown */}} {{ .desc | safeHTML }} </div> </div> </div> {{ end -}} </div>