move common parts to partials
This commit is contained in:
		
							parent
							
								
									0e193e6394
								
							
						
					
					
						commit
						ef404bc09b
					
				
					 8 changed files with 107 additions and 149 deletions
				
			
		|  | @ -15,7 +15,6 @@ html,body { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| img { | img { | ||||||
|     max-width: 100%; |     max-width: 100%; | ||||||
| } | } | ||||||
|  | @ -31,15 +30,20 @@ img { | ||||||
|     margin-top: 10px; |     margin-top: 10px; | ||||||
| } | } | ||||||
| .mt25 { | .mt25 { | ||||||
|     margin-top: 0; |     margin-top: 10; | ||||||
|     @include media-query($on-palm) { |     @include media-query($on-palm) { | ||||||
|         margin-top: 25px; |         margin-top: 25px; | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .p20{ | .p10 { | ||||||
|  |     padding: 10px 0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .p20 { | ||||||
|     padding: 20px 0; |     padding: 20px 0; | ||||||
| } | } | ||||||
|  | 
 | ||||||
| .navbar-brand { | .navbar-brand { | ||||||
|     font-weight: 900; |     font-weight: 900; | ||||||
|     font-size: 1.85em; |     font-size: 1.85em; | ||||||
|  | @ -80,8 +84,6 @@ img { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| footer { | footer { | ||||||
|     border-top: 1px solid $grey-color-light; |     border-top: 1px solid $grey-color-light; | ||||||
| } | } | ||||||
|  | @ -90,8 +92,8 @@ footer { | ||||||
|     list-style: none; |     list-style: none; | ||||||
|     display: inline; |     display: inline; | ||||||
|     margin-left: 10px; |     margin-left: 10px; | ||||||
|     padding: 5px 8px; |     padding: 4px 3px; | ||||||
|     font-size: 1.25em; |     font-size: 1.4em; | ||||||
|     } |     } | ||||||
| .social:hover { | .social:hover { | ||||||
|      opacity: 0.7; |      opacity: 0.7; | ||||||
|  |  | ||||||
|  | @ -17,9 +17,6 @@ | ||||||
| 
 | 
 | ||||||
|   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> |   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> | ||||||
|   <script src="{{ .Site.BaseURL }}/js/bootstrap.min.js"></script> |   <script src="{{ .Site.BaseURL }}/js/bootstrap.min.js"></script> | ||||||
|   {{ with .Site.Params.analytics }}  |  | ||||||
|     {{ partial "analytics.html" . }} |  | ||||||
|   {{ end }} |  | ||||||
|   </body> |   </body> | ||||||
| 
 | 
 | ||||||
| </html> | </html> | ||||||
|  | @ -6,67 +6,17 @@ | ||||||
|       Front Matter |       Front Matter | ||||||
|   </div> |   </div> | ||||||
|    |    | ||||||
|   <div class="row pack"> |   <div class="row"> | ||||||
| 
 | 
 | ||||||
|     {{ $paginator := .Paginate (where .Site.RegularPages "Section" "posts") }} |     {{ $paginator := .Paginate (where .Site.RegularPages "Section" "posts") }} | ||||||
|     {{ range $paginator.Pages }}    |     {{ range $paginator.Pages }}    | ||||||
|           <div class="col-md-4 card"> |       {{ partial "card.html" . }} | ||||||
|            <a href="{{ .Permalink }}" class="index-anchor">     |  | ||||||
|               <div class="panel panel-default"> |  | ||||||
|                  |  | ||||||
|                 {{ if .Params.img }} |  | ||||||
|                 <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Params.img }}" alt="{{ .Title }}"> |  | ||||||
|                 {{ else }} |  | ||||||
|                 <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Site.Params.defaultImage }}" alt="{{ .Site.Title }}"> |  | ||||||
|                 {{ end }} |  | ||||||
|                  |  | ||||||
|                 <div class="panel-body"> |  | ||||||
|                   <h3 class="panel-title pull-left">{{ .Title | truncate 25 }}</h3><span class="post-meta pull-right"><small>{{ .Date.Format (i18n "dateFormat") }}</small></span> |  | ||||||
|                 </div> |  | ||||||
|                  |  | ||||||
|                 <div class="panel-body"><small> |  | ||||||
|                   {{ .Summary | plainify | truncate 180 }}</small> |  | ||||||
|                 </div> |  | ||||||
|               </div> |  | ||||||
|               </a> |  | ||||||
|           </div> |  | ||||||
|        |  | ||||||
|     {{ end }} |     {{ end }} | ||||||
| 
 | 
 | ||||||
|   </div>  |   </div>  | ||||||
|      |      | ||||||
|   <div class="row"> |   <div class="row"> | ||||||
|     <div class="col-md-4">  </div> |     {{ partial "pagination.html" . }} | ||||||
|     <div class="col-md-4"> |  | ||||||
|         {{ if gt .Paginator.TotalPages 1 }} |  | ||||||
|         <ul class="pagination"> |  | ||||||
|           {{ if .Paginator.HasPrev }} |  | ||||||
|             <li><a href="{{ .Paginator.Prev.URL }}">« {{i18n "prev"}}</a></li> |  | ||||||
|           {{ else }} |  | ||||||
|             <li><span>« {{i18n "prev"}}</span></li> |  | ||||||
|           {{ end }} |  | ||||||
| 
 |  | ||||||
|           {{ $scratch := newScratch }} |  | ||||||
|           {{ $scratch.Set "current" .Paginator.PageNumber }}  |  | ||||||
| 
 |  | ||||||
|           {{ range .Paginator.Pagers }} |  | ||||||
|             {{ if eq .PageNumber ($scratch.Get "current") }} |  | ||||||
|               <li class="active"><span><em>{{ .PageNumber }}</em></span></li> |  | ||||||
|             {{ else }} |  | ||||||
|             <li><a href="{{ .URL }}">{{ .PageNumber }}</a></li> |  | ||||||
|             {{ end }} |  | ||||||
|           {{ end }} |  | ||||||
| 
 |  | ||||||
|           {{ if .Paginator.HasNext }} |  | ||||||
|             <li><a href="{{ .Paginator.Next.URL }}">{{i18n "next"}} »</a></li> |  | ||||||
|           {{ else }} |  | ||||||
|             <li><span >{{i18n "next"}} »</span></li> |  | ||||||
|           {{ end }} |  | ||||||
|           </ul> |  | ||||||
|         {{ end }} |  | ||||||
| 
 |  | ||||||
|     </div> |  | ||||||
|     <div class="col-md-4">  </div> |  | ||||||
|   </div> |   </div> | ||||||
| 
 | 
 | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
							
								
								
									
										22
									
								
								layouts/partials/card.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								layouts/partials/card.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | ||||||
|  | 
 | ||||||
|  | <div class="col-md-4"> | ||||||
|  |  <a href="{{ .Permalink }}" class="index-anchor"> | ||||||
|  |     <div class="panel panel-default"> | ||||||
|  |        | ||||||
|  |       {{ if .Params.img }} | ||||||
|  |         <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Params.img }}" alt="{{ .Title }}"> | ||||||
|  |       {{ else if .Site.Params.defaultImage }} | ||||||
|  |         <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Site.Params.defaultImage }}" alt="{{ .Site.Title }}"> | ||||||
|  |       {{ end }} | ||||||
|  | 
 | ||||||
|  |       <div class="panel-body"> | ||||||
|  |         <h3 class="panel-title pull-left">{{ .Title | truncate 25 }}</h3><span class="post-meta pull-right"><small>{{ .Date.Format (i18n "dateFormat") }}</small></span> | ||||||
|  |       </div> | ||||||
|  |        | ||||||
|  |       <div class="panel-body"><small> | ||||||
|  |         {{ .Summary | plainify | truncate 100 }}</small> | ||||||
|  |       </div> | ||||||
|  |     </div> | ||||||
|  |   </a> | ||||||
|  | </div> | ||||||
|  |        | ||||||
|  | @ -1,9 +1,12 @@ | ||||||
| <footer> | <footer> | ||||||
|   <div class="container"> |   <div class="container"> | ||||||
|         <div class="row p20"> |     <div class="row p10"> | ||||||
| 
 | 
 | ||||||
|       {{ with .Site.Params.copyright }} |       {{ with .Site.Params.copyright }} | ||||||
|               <div class="col-md-4 text-left mt25">Copyright <a target="_blank" href="{{ .link }}">{{ .name }}</a></div> |         <div class="col-md-4 text-left mt25"> | ||||||
|  |           <span class="fa fa-copyright"></span> | ||||||
|  |           <a target="_blank" href="{{.link}}">{{ .name }}</a> | ||||||
|  |         </div> | ||||||
|       {{ end }} |       {{ end }} | ||||||
| 
 | 
 | ||||||
|       <div class="col-md-4 text-center mt25" > |       <div class="col-md-4 text-center mt25" > | ||||||
|  | @ -12,14 +15,17 @@ | ||||||
|         {{ end }} |         {{ end }} | ||||||
|       </div> |       </div> | ||||||
| 
 | 
 | ||||||
|           <div class="col-md-4 text-right mt25"> |       <ul class="col-md-4 text-right mt25"> | ||||||
|         {{with  .Site.Params.github }} |         {{with  .Site.Params.github }} | ||||||
|               <a target="_blank" href="{{.}}"><li class="social github"><i class="fa fa-github-square"></i></li></a> |           <a target="_blank" title="GitHub" href="{{.}}" title="GitHub"><li class="social github"><i class="fa fa-github-square"></i></li></a> | ||||||
|  |         {{ end }} | ||||||
|  |         {{with  .Site.Params.sourcehut }} | ||||||
|  |           <a target="_blank" title="sourcehut git" href="{{.}}"><li class="social sourcehut"><i class="fa fa-git-square"></i></li></a> | ||||||
|         {{ end }} |         {{ end }} | ||||||
|         {{ with  .Site.Params.email }} |         {{ with  .Site.Params.email }} | ||||||
|               <a target="_blank" href="mailto:{{.}}"><li class="social email"><i class="fa fa-envelope"></i></li></a> |           <a target="_blank" title="Email" href="mailto:{{.}}"><li class="social email"><i class="fa fa-envelope"></i></li></a> | ||||||
|         {{ end }} |         {{ end }} | ||||||
|           </div> |       </ul> | ||||||
| 
 | 
 | ||||||
|     </div>  |     </div>  | ||||||
|   </div> |   </div> | ||||||
|  |  | ||||||
							
								
								
									
										32
									
								
								layouts/partials/pagination.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								layouts/partials/pagination.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | ||||||
|  |     <div class="col-md-4"> </div> | ||||||
|  |     <div class="col-md-4"> | ||||||
|  |         {{ if gt .Paginator.TotalPages 1 }} | ||||||
|  |         <ul class="pagination"> | ||||||
|  |           {{ if .Paginator.HasPrev }} | ||||||
|  |             <li><a href="{{ .Paginator.Prev.URL }}">« Prev</a></li> | ||||||
|  |           {{ else }} | ||||||
|  |             <li><span>« Prev</span></li> | ||||||
|  |           {{ end }} | ||||||
|  | 
 | ||||||
|  |           {{ $scratch := newScratch }} | ||||||
|  |           {{ $scratch.Set "current" .Paginator.PageNumber }}  | ||||||
|  | 
 | ||||||
|  |           {{ range .Paginator.Pagers }} | ||||||
|  |             {{ if eq .PageNumber ($scratch.Get "current") }} | ||||||
|  |               <li class="active"><span><em>{{ .PageNumber }}</em></span></li> | ||||||
|  |             {{ else }} | ||||||
|  |             <li><a href="{{ .URL }}">{{ .PageNumber }}</a></li> | ||||||
|  |             {{ end }} | ||||||
|  |           {{ end }} | ||||||
|  | 
 | ||||||
|  |           {{ if .Paginator.HasNext }} | ||||||
|  |             <li><a href="{{ .Paginator.Next.URL }}">Next »</a></li> | ||||||
|  |           {{ else }} | ||||||
|  |             <li><span >Next »</span></li> | ||||||
|  |           {{ end }} | ||||||
|  |           </ul> | ||||||
|  |         {{ end }} | ||||||
|  | 
 | ||||||
|  |     </div> | ||||||
|  |     <div class="col-md-4"> </div> | ||||||
|  | 
 | ||||||
|  | @ -7,67 +7,17 @@ | ||||||
|         <br /> |         <br /> | ||||||
|   </div> |   </div> | ||||||
| 
 | 
 | ||||||
|  |   <div class="row"> | ||||||
|  | 
 | ||||||
|     {{ $paginator := .Paginate (.Data.Pages) }} |     {{ $paginator := .Paginate (.Data.Pages) }} | ||||||
|   <div class="row"> |  | ||||||
| 
 |  | ||||||
|     {{ range $paginator.Pages }} |     {{ range $paginator.Pages }} | ||||||
|           <div class="col-md-4"> |       {{ partial "card.html" . }} | ||||||
|            <a href="{{ .Permalink }}" class="index-anchor"> |  | ||||||
|               <div class="panel panel-default"> |  | ||||||
|                  |  | ||||||
|                 {{ if .Params.img }} |  | ||||||
|                 <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Params.img }}" alt="{{ .Title }}"> |  | ||||||
|                 {{ else }} |  | ||||||
|                 <img width="100%" src="{{ .Site.BaseURL }}images/{{ .Site.Params.defaultImage }}" alt="{{ .Site.Title }}"> |  | ||||||
|                 {{ end }} |  | ||||||
|                  |  | ||||||
|                 <div class="panel-body"> |  | ||||||
|                   <h3 class="panel-title pull-left">{{ .Title | truncate 25 }}</h3><span class="post-meta pull-right"><small>{{ .Date.Format (i18n "dateFormat") }}</small></span> |  | ||||||
|                 </div> |  | ||||||
|                  |  | ||||||
|                 <div class="panel-body"><small> |  | ||||||
|                   {{ .Summary | plainify | truncate 180 }}</small> |  | ||||||
|                 </div> |  | ||||||
|               </div> |  | ||||||
|             </a> |  | ||||||
|           </div> |  | ||||||
|        |  | ||||||
|     {{ end }} |     {{ end }} | ||||||
| 
 | 
 | ||||||
|   </div>  |   </div>  | ||||||
|      |      | ||||||
|   <div class="row"> |   <div class="row"> | ||||||
|     <div class="col-md-4"> </div> |     {{ partial "pagination.html" . }} | ||||||
|     <div class="col-md-4"> |  | ||||||
|         {{ if gt .Paginator.TotalPages 1 }} |  | ||||||
|         <ul class="pagination"> |  | ||||||
|           {{ if .Paginator.HasPrev }} |  | ||||||
|             <li><a href="{{ .Paginator.Prev.URL }}">« Prev</a></li> |  | ||||||
|           {{ else }} |  | ||||||
|             <li><span>« Prev</span></li> |  | ||||||
|           {{ end }} |  | ||||||
| 
 |  | ||||||
|           {{ $scratch := newScratch }} |  | ||||||
|           {{ $scratch.Set "current" .Paginator.PageNumber }}  |  | ||||||
| 
 |  | ||||||
|           {{ range .Paginator.Pagers }} |  | ||||||
|             {{ if eq .PageNumber ($scratch.Get "current") }} |  | ||||||
|               <li class="active"><span><em>{{ .PageNumber }}</em></span></li> |  | ||||||
|             {{ else }} |  | ||||||
|             <li><a href="{{ .URL }}">{{ .PageNumber }}</a></li> |  | ||||||
|             {{ end }} |  | ||||||
|           {{ end }} |  | ||||||
| 
 |  | ||||||
|           {{ if .Paginator.HasNext }} |  | ||||||
|             <li><a href="{{ .Paginator.Next.URL }}">Next »</a></li> |  | ||||||
|           {{ else }} |  | ||||||
|             <li><span >Next »</span></li> |  | ||||||
|           {{ end }} |  | ||||||
|           </ul> |  | ||||||
|         {{ end }} |  | ||||||
| 
 |  | ||||||
|     </div> |  | ||||||
|     <div class="col-md-4"> </div> |  | ||||||
|   </div> |   </div> | ||||||
| 
 | 
 | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
|  | @ -1,7 +1,6 @@ | ||||||
| # theme.yaml template for a Hugo theme | # theme.yaml | ||||||
| # See https://github.com/gohugoio/hugoThemes#themetoml for an example |  | ||||||
| 
 | 
 | ||||||
| name: Cybercards | name: cybercards | ||||||
| license: "MIT" | license: "MIT" | ||||||
| licenselink: "https://github.com/bul-ikana/hugo-cards/blob/master/LICENSE.md" | licenselink: "https://github.com/bul-ikana/hugo-cards/blob/master/LICENSE.md" | ||||||
| description: "A bootstrap based minimal hugo theme based on webjeda-cards" | description: "A bootstrap based minimal hugo theme based on webjeda-cards" | ||||||
|  | @ -11,8 +10,8 @@ features: [] | ||||||
| min_version: "0.57.0" | min_version: "0.57.0" | ||||||
| 
 | 
 | ||||||
| author: | author: | ||||||
|   name: "Hugo Aguirre" |   name: "cyberconcepts.org team" | ||||||
|   homepage: "https://bool.netlify.com" |   homepage: "https://www.cyberconcepts.org" | ||||||
| 
 | 
 | ||||||
| # If porting an existing theme | # If porting an existing theme | ||||||
| original: | original: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue