Extract series navigation into a partial
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
		
							parent
							
								
									25e9057dd8
								
							
						
					
					
						commit
						db9433bda1
					
				@ -27,19 +27,7 @@
 | 
			
		||||
</div>
 | 
			
		||||
{{ end }}
 | 
			
		||||
{{ define "after" }}
 | 
			
		||||
{{ $term := index (.GetTerms "series") 0 }}
 | 
			
		||||
{{ with $term }}
 | 
			
		||||
{{- /* No idea why the 'Reverse' is needed? */ -}}
 | 
			
		||||
{{ $pages := (site.Taxonomies.series.Get .Data.Term).Pages.ByDate.Reverse }}
 | 
			
		||||
<nav id="SeriesNavigation" class="container">
 | 
			
		||||
{{ with $pages.Prev page }}
 | 
			
		||||
{{ partial "serieslink.html" (dict "direction" "previous" "link" .RelPermalink "page" .) }}
 | 
			
		||||
{{ end }}
 | 
			
		||||
{{ with $pages.Next page }}
 | 
			
		||||
{{ partial "serieslink.html" (dict "direction" "next" "link" .RelPermalink "page" .) }}
 | 
			
		||||
{{ end }}
 | 
			
		||||
</nav>
 | 
			
		||||
{{ end }}
 | 
			
		||||
{{- partial "seriesnav.html" . -}}
 | 
			
		||||
<hr class="container footer-divider">
 | 
			
		||||
<footer class="container">
 | 
			
		||||
    <p>{{ i18n "contactFooter" | safeHTML }}</p>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										13
									
								
								layouts/partials/seriesnav.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								layouts/partials/seriesnav.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
{{ $term := index (.GetTerms "series") 0 }}
 | 
			
		||||
{{ with $term }}
 | 
			
		||||
{{- /* No idea why the 'Reverse' is needed? */ -}}
 | 
			
		||||
{{ $pages := (site.Taxonomies.series.Get .Data.Term).Pages.ByDate.Reverse }}
 | 
			
		||||
<nav id="SeriesNavigation" class="container">
 | 
			
		||||
{{ with $pages.Prev page }}
 | 
			
		||||
{{ partial "serieslink.html" (dict "direction" "previous" "link" .RelPermalink "page" .) }}
 | 
			
		||||
{{ end }}
 | 
			
		||||
{{ with $pages.Next page }}
 | 
			
		||||
{{ partial "serieslink.html" (dict "direction" "next" "link" .RelPermalink "page" .) }}
 | 
			
		||||
{{ end }}
 | 
			
		||||
</nav>
 | 
			
		||||
{{ end }}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user