more on taxonomy layout templates
This commit is contained in:
		
							parent
							
								
									165f3f16bd
								
							
						
					
					
						commit
						62e945e785
					
				
					 5 changed files with 40 additions and 65 deletions
				
			
		|  | @ -97,7 +97,7 @@ | ||||||
| 		 "header" (i18n "sibling-articles") "id" "siblings") -}} | 		 "header" (i18n "sibling-articles") "id" "siblings") -}} | ||||||
|   {{- end -}} |   {{- end -}} | ||||||
| 
 | 
 | ||||||
|   {{- if not .Site.Params.hideSectionArticles -}} |   {{- if not (.Param "hideSectionArticles") -}} | ||||||
|     {{- $section := or .Section "posts" -}} |     {{- $section := or .Section "posts" -}} | ||||||
|     {{- $header := or (i18n (printf "articles-in-%s" $section)) (i18n "articles-in-section") -}} |     {{- $header := or (i18n (printf "articles-in-%s" $section)) (i18n "articles-in-section") -}} | ||||||
|     {{- $related := first 20 (where .Site.RegularPages "Section" $section) -}} |     {{- $related := first 20 (where .Site.RegularPages "Section" $section) -}} | ||||||
|  |  | ||||||
|  | @ -1,32 +0,0 @@ | ||||||
| {{ define "main" }} |  | ||||||
| 
 |  | ||||||
| <div id="home"> |  | ||||||
| 
 |  | ||||||
|   <div class="row"> |  | ||||||
|     <div class="col-md-12"> |  | ||||||
|       <div class="card mt-3"> |  | ||||||
|         <div class="card-body bg-light"> |  | ||||||
|           <h2 class="card-text"> {{or (i18n .Title) .Title }}</h2> |  | ||||||
|         </div> |  | ||||||
|       </div> |  | ||||||
|     </div> |  | ||||||
|   </div> |  | ||||||
| 
 |  | ||||||
|   <div class="row"> |  | ||||||
|     {{- $site := .Site }} |  | ||||||
|     {{ range .Data.Terms.ByCount -}} |  | ||||||
|     <div class="col-md-{{or $site.Params.TaxoWidth 4}} mt-3"> |  | ||||||
|       <div class="card"> |  | ||||||
|         <a href="{{ .Page.Permalink }}"  |  | ||||||
|            class="list-group-item d-flex justify-content-between align-items-center"> |  | ||||||
|           {{ .Page.Title }} |  | ||||||
|           <span class="badge rounded-pill bg-secondary">{{ .Count }}</span> |  | ||||||
|         </a> |  | ||||||
|       </div> |  | ||||||
|     </div> |  | ||||||
|     {{- end }} |  | ||||||
|   </div> |  | ||||||
| 
 |  | ||||||
| </div> |  | ||||||
| 
 |  | ||||||
| {{ end }} |  | ||||||
|  | @ -1,32 +0,0 @@ | ||||||
| {{ define "main" }} |  | ||||||
| 
 |  | ||||||
| <div id="home"> |  | ||||||
| 
 |  | ||||||
|   <div class="row"> |  | ||||||
|     <div class="col-md-12"> |  | ||||||
|       <div class="card mt-3"> |  | ||||||
|         <div class="card-body bg-light"> |  | ||||||
|           <h2 class="card-text"> {{or (i18n .Title) .Title }}</h2> |  | ||||||
|         </div> |  | ||||||
|       </div> |  | ||||||
|     </div> |  | ||||||
|   </div> |  | ||||||
| 
 |  | ||||||
|   <div class="row"> |  | ||||||
|     {{- $site := .Site }} |  | ||||||
|     {{ range .Data.Terms.ByCount -}} |  | ||||||
|     <div class="col-md-{{or $site.Params.TaxoWidth 4}} mt-3"> |  | ||||||
|       <div class="card"> |  | ||||||
|         <a href="{{ .Page.Permalink }}"  |  | ||||||
|            class="list-group-item d-flex justify-content-between align-items-center"> |  | ||||||
|           {{ .Page.Title }} |  | ||||||
|           <span class="badge rounded-pill bg-secondary">{{ .Count }}</span> |  | ||||||
|         </a> |  | ||||||
|       </div> |  | ||||||
|     </div> |  | ||||||
|     {{- end }} |  | ||||||
|   </div> |  | ||||||
| 
 |  | ||||||
| </div> |  | ||||||
| 
 |  | ||||||
| {{ end }} |  | ||||||
							
								
								
									
										39
									
								
								layouts/section.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								layouts/section.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,39 @@ | ||||||
|  | {{ define "main" }} | ||||||
|  | 
 | ||||||
|  | <div class="home"> | ||||||
|  |   | ||||||
|  |   {{- $parents := .Params.Topics -}} | ||||||
|  |   {{- $mainWidth := or (and $parents "8") "12" -}} | ||||||
|  |   <div class="row"> | ||||||
|  |     <div class="col-md-{{ $mainWidth }}"> | ||||||
|  |       <div class="card mt-3 mb-3"> | ||||||
|  |         {{ if .Title -}} | ||||||
|  |         <header class="card-header" id="cs-header"> | ||||||
|  |           <h2 class="card-text">{{ .Title }}</h2> | ||||||
|  |         </header> | ||||||
|  |         {{- end }} | ||||||
|  |         <div class="card-body"> | ||||||
|  |           <div id="cs-info"></div> | ||||||
|  |           <p class="card-text" id="cs-content">{{ .Content }}</p> | ||||||
|  | 		  <div id="cs-debug"></div> | ||||||
|  |         </div> | ||||||
|  |       </div> | ||||||
|  |     </div> | ||||||
|  |     {{ partial "parent-topics.html" . }} | ||||||
|  |   </div> | ||||||
|  | 
 | ||||||
|  |   <div class="row"> | ||||||
|  |     {{ $section := or .Section .Site.Params.homeSection "posts" }} | ||||||
|  |     {{ $paginator := .Paginate (where .Site.RegularPages "Section" $section) }} | ||||||
|  |     {{ range $paginator.Pages }}    | ||||||
|  |       {{ partial "card" . }} | ||||||
|  |     {{ end }} | ||||||
|  |   </div> | ||||||
|  | 
 | ||||||
|  |   <div class="row"> | ||||||
|  |     {{ partial "pagination.html" . }} | ||||||
|  |   </div> | ||||||
|  | 
 | ||||||
|  | </div> | ||||||
|  | 
 | ||||||
|  | {{ end }} | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue