add 'cards' shortcode; + minor fixes and improvements
This commit is contained in:
		
							parent
							
								
									438cdd54e0
								
							
						
					
					
						commit
						5326e4f7b4
					
				
					 4 changed files with 15 additions and 10 deletions
				
			
		|  | @ -12,9 +12,9 @@ | |||
|              itemscope itemtype="http://schema.org/BlogPosting"> | ||||
|       {{- partial "content" . -}} | ||||
| 	  {{- if eq $showChildren "embed" -}} | ||||
|         {{ range sort (sort $children "Date" "desc") "Weight" }} | ||||
| 	      {{ partial "embed" . }} | ||||
|         {{ end }} | ||||
|         {{- range sort (sort $children "Date" "desc") "Weight" }} | ||||
| 	      {{ partial "embed" . -}} | ||||
|         {{- end -}} | ||||
| 	  {{- end -}} | ||||
|     </article> | ||||
|   </div> | ||||
|  | @ -25,9 +25,9 @@ | |||
| 
 | ||||
| {{- if hasPrefix $showChildren "card" -}} | ||||
| <div class="row"> | ||||
|   {{ range sort (sort $children "Date" "desc") "Weight" }} | ||||
|     {{ partial "card" . }} | ||||
|   {{ end }} | ||||
|   {{- range sort (sort $children "Date" "desc") "Weight" }} | ||||
|     {{ partial "card" . -}} | ||||
|   {{- end -}} | ||||
| </div> | ||||
| {{- end }} | ||||
| 
 | ||||
|  |  | |||
|  | @ -29,10 +29,9 @@ | |||
|          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 -}} | ||||
|     {{- if and (not .Params.nodate) .Date -}} | ||||
|     <span class="post-meta pull-right"> | ||||
|       <small>{{ .Date.Format (i18n "dateFormat") }}</small></span> | ||||
|     {{- end }} | ||||
|  |  | |||
							
								
								
									
										7
									
								
								layouts/shortcodes/cards.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								layouts/shortcodes/cards.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| <div class="row"> | ||||
| {{- range split .Inner " " -}} | ||||
| {{- range where $.Site.Pages "Params.pageid" "eq" . }} | ||||
| {{ partial "card" . -}} | ||||
| {{- end -}} | ||||
| {{- end -}} | ||||
| </div> | ||||
|  | @ -9,8 +9,7 @@ | |||
| {{- $anchor := printf "link-%d" $linkid -}} | ||||
| {{- range $pages -}} | ||||
|   {{- if ne $title "none" -}} | ||||
| ### [{{ or $title .Title }}]({{ .Permalink }}) {#{{ $anchor }}} | ||||
|     {{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this "btext" $btext "btitle" $btitle)) -}} | ||||
| ### [{{ or $title .Title }}]({{ .Permalink }})  | ||||
|   {{- end -}} | ||||
|   {{ .RenderShortcodes }} | ||||
| {{- end -}} | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue