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"> |              itemscope itemtype="http://schema.org/BlogPosting"> | ||||||
|       {{- partial "content" . -}} |       {{- partial "content" . -}} | ||||||
| 	  {{- if eq $showChildren "embed" -}} | 	  {{- if eq $showChildren "embed" -}} | ||||||
|         {{ range sort (sort $children "Date" "desc") "Weight" }} |         {{- range sort (sort $children "Date" "desc") "Weight" }} | ||||||
| 	      {{ partial "embed" . }} | 	      {{ partial "embed" . -}} | ||||||
|         {{ end }} |         {{- end -}} | ||||||
| 	  {{- end -}} | 	  {{- end -}} | ||||||
|     </article> |     </article> | ||||||
|   </div> |   </div> | ||||||
|  | @ -25,9 +25,9 @@ | ||||||
| 
 | 
 | ||||||
| {{- if hasPrefix $showChildren "card" -}} | {{- if hasPrefix $showChildren "card" -}} | ||||||
| <div class="row"> | <div class="row"> | ||||||
|   {{ range sort (sort $children "Date" "desc") "Weight" }} |   {{- range sort (sort $children "Date" "desc") "Weight" }} | ||||||
|     {{ partial "card" . }} |     {{ partial "card" . -}} | ||||||
|   {{ end }} |   {{- end -}} | ||||||
| </div> | </div> | ||||||
| {{- end }} | {{- end }} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -29,10 +29,9 @@ | ||||||
|          src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}"  |          src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}"  | ||||||
|          alt="{{ .Site.Title }}"> |          alt="{{ .Site.Title }}"> | ||||||
|   {{- end }} |   {{- end }} | ||||||
| 
 |  | ||||||
|   <div class="card-body"> |   <div class="card-body"> | ||||||
|     <span class="card-title h4">{{ .Title | truncate 30 }}</span> |     <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"> |     <span class="post-meta pull-right"> | ||||||
|       <small>{{ .Date.Format (i18n "dateFormat") }}</small></span> |       <small>{{ .Date.Format (i18n "dateFormat") }}</small></span> | ||||||
|     {{- end }} |     {{- 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 -}} | {{- $anchor := printf "link-%d" $linkid -}} | ||||||
| {{- range $pages -}} | {{- range $pages -}} | ||||||
|   {{- if ne $title "none" -}} |   {{- if ne $title "none" -}} | ||||||
| ### [{{ or $title .Title }}]({{ .Permalink }}) {#{{ $anchor }}} | ### [{{ or $title .Title }}]({{ .Permalink }})  | ||||||
|     {{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this "btext" $btext "btitle" $btitle)) -}} |  | ||||||
|   {{- end -}} |   {{- end -}} | ||||||
|   {{ .RenderShortcodes }} |   {{ .RenderShortcodes }} | ||||||
| {{- end -}} | {{- end -}} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue