83 lines
		
	
	
	
		
			2.9 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			83 lines
		
	
	
	
		
			2.9 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <div class="col-md-4 mt20">
 | |
| 
 | |
|     {{ if .Params.img -}}
 | |
|     <img width="100%" class="mt-3"
 | |
|          src="{{ .Site.BaseURL}}img/{{ .Params.img }}" alt="{{ .Params.title }}">
 | |
|     {{- else if .Params.teaser -}}
 | |
|     <div class="card mt-3">
 | |
|       <div class="card-body bg-light">
 | |
|         <h5 class="card-text">{{ .Params.teaser }}</h5>
 | |
|       </div>
 | |
|     </div>
 | |
|     {{- else if .Site.Params.defaultImage -}}
 | |
|     <img width="100%"  class="mt-3"
 | |
|          src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}" alt="dummy">
 | |
|     {{- else if .Params.Summary -}}
 | |
|     <div class="card mt-3">
 | |
|       <div class="card-body bg-light">
 | |
|         <h5 class="card-text">{{ .Params.Summary }}</h5>
 | |
|       </div>
 | |
|     </div>
 | |
|     {{- end }}
 | |
| 
 | |
|     {{- $site := .Site -}}
 | |
|     {{ with .Params.Topics -}}
 | |
|     <div class="card mt-3">
 | |
|       <div class="card-header">
 | |
|         <h4 class="card-text">{{i18n "topics"}}</h4>
 | |
|       </div>
 | |
|       <div class="card-body">
 | |
|           {{ range . -}}
 | |
|           {{- $page := $site.GetPage (printf "/topics/%s" .) -}}
 | |
|           <span class="badge rounded-pill bg-secondary m-1">
 | |
|             <a href="{{ $page.Permalink }}">{{ $page.Title }}</a>
 | |
|           </span>
 | |
|           {{- end }}
 | |
|       </div>
 | |
|     </div>
 | |
|     {{- end }}
 | |
| 
 | |
|     {{ if not .Site.Params.hideParentArticles -}}
 | |
|       {{- $related :=  where .Site.RegularPages "Params.pageid" "in" .Params.parents -}}
 | |
|       {{- partial "card-related" 
 | |
|           (dict "related" $related "header" (i18n "parent-articles") "id" "parents") -}}
 | |
|     {{- end }}
 | |
| 
 | |
|     {{ if not .Site.Params.hideChildArticles -}}
 | |
|       {{- $related :=  .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}}
 | |
|       {{- partial "card-related" 
 | |
|           (dict "related" $related "header" (i18n "child-articles") "id" "children") -}}
 | |
|     {{- end }}
 | |
| 
 | |
|     {{ if not .Site.Params.hideRelatedArticles -}}
 | |
|       {{- $related :=  .Site.RegularPages.RelatedIndices . "topics" -}}
 | |
|       {{- partial "card-related" 
 | |
|           (dict "related" $related "header" (i18n "related-articles") "id" "related") -}}
 | |
|     {{- end }}
 | |
| 
 | |
|     {{ if not .Site.Params.hideSiblingArticles -}}
 | |
|       {{- $related :=  .Site.RegularPages.RelatedIndices . "parents" -}}
 | |
|       {{- partial "card-related" 
 | |
|           (dict "related" $related "header" (i18n "sibling-articles") "id" "siblings") -}}
 | |
|     {{- end }}
 | |
| 
 | |
|     {{ if not .Site.Params.hideSectionArticles -}}
 | |
|       {{- $section := or .Section "posts" -}}
 | |
|       {{- $header := or (i18n (printf "articles-in-%s" $section)) (i18n "articles-in-section") -}}
 | |
|       {{- $related := first 20 (where .Site.RegularPages "Section" $section) -}}
 | |
|         {{- partial "card-related" 
 | |
|             (dict "related" $related "header" $header "id" "articles-in-section") -}}
 | |
|     {{- end }}
 | |
| 
 | |
|     {{ if .Params.toc -}}
 | |
|     <div class="card mt-3">
 | |
|       <div class="card-header">
 | |
|         <h4 class="card-text">{{i18n "toc"}}</h4>
 | |
|       </div>
 | |
|       <div class="card-body">
 | |
|         {{ .TableOfContents }}
 | |
|       </div>
 | |
|     </div>
 | |
|     {{ end -}}
 | |
| 
 | |
| </div>
 |