38 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <div class="col-md-4">
 | |
| <div class="card mb-3">
 | |
| <a href="{{ .Permalink }}" class="index-anchor">
 | |
|   {{- $img := .Params.img -}}
 | |
|   {{- $refImg := "" -}}
 | |
|   {{- if .Params.imgref -}}
 | |
|     {{- range where .Site.RegularPages "Params.pageid" "eq" .Params.imgref -}}
 | |
|       {{- $refImg = .Params.img -}}
 | |
|     {{- end -}}
 | |
|   {{- end -}}
 | |
|   {{- if not $img -}}
 | |
|     {{- $img = $refImg -}}
 | |
|   {{- end -}}
 | |
|   {{ if $img -}}
 | |
|     {{- $image := (resources.Get (printf "img/%s" $img)).Resize "400x" -}}
 | |
|     <img width="100%" 
 | |
|          src="{{ $image.RelPermalink }}" alt="{{ .Title }}">
 | |
|   {{ else if .Params.teaser }}
 | |
|     <div class="card-header">
 | |
|       <p class="card-text">{{ .Params.teaser }}</p>
 | |
|     </div>
 | |
|   {{ else if .Site.Params.defaultImage }}
 | |
|     <img width="100%" 
 | |
|          src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}" 
 | |
|          alt="{{ .Site.Title }}">
 | |
|   {{ end }}
 | |
| 
 | |
|   <div class="card-body">
 | |
|     <span class="card-title h4">{{ .Title | truncate 30 }}</span>
 | |
|     {{ if and (not .Params.nodate) .Date -}}
 | |
|     <span class="post-meta pull-right">
 | |
|       <small>{{ .Date.Format (i18n "dateFormat") }}</small></span>
 | |
|     {{- end }}
 | |
|     <p class="card-text">{{ .Summary | truncate 100 }}</p>
 | |
|   </div>
 | |
| </a>
 | |
| </div>
 | |
| </div>
 |