Initial version
This commit is contained in:
		
				commit
				
					
						ed5653a7fc
					
				
			
		
					 211 changed files with 11043 additions and 0 deletions
				
			
		
							
								
								
									
										29
									
								
								themes/zen/layouts/partials/meta_breadcrumb_json_ld.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								themes/zen/layouts/partials/meta_breadcrumb_json_ld.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | |||
| {{ $breadcrumbScratch := newScratch -}} | ||||
| {{ $crumbScratch := newScratch -}} | ||||
| {{ $crumbScratch.Set "itemListElement" (slice) -}} | ||||
| {{ $breadPos := 0 -}} | ||||
| {{ range .Ancestors.Reverse -}} | ||||
|   {{ $breadPos = (add $breadPos 1) -}} | ||||
|   {{ $crumbScratch.Add "itemListElement" (dict | ||||
|     "@type" "ListItem" | ||||
|     "position" $breadPos | ||||
|     "item" (dict | ||||
|       "@id" .Permalink | ||||
|       "name" .LinkTitle | ||||
|     ) | ||||
|   ) -}} | ||||
| {{ end -}} | ||||
| {{ $breadPos = (add $breadPos 1) -}} | ||||
| {{ $crumbScratch.Add "itemListElement" (dict | ||||
|   "@type" "ListItem" | ||||
|   "position" $breadPos | ||||
|   "item" (dict | ||||
|     "@id" .Permalink | ||||
|     "name" .LinkTitle | ||||
|   ) | ||||
| ) -}} | ||||
| {{ $breadcrumbScratch.SetInMap "breadcrumb" "@context" "https://schema.org" -}} | ||||
| {{ $breadcrumbScratch.SetInMap "breadcrumb" "@type" "BreadcrumbList" -}} | ||||
| {{ $breadcrumbScratch.SetInMap "breadcrumb" "itemListElement" ($crumbScratch.Get "itemListElement") -}} | ||||
| {{ $jsonifiedBreadcrumb := $breadcrumbScratch.Get "breadcrumb" | jsonify (dict "indent" "  " "prefix" "    ") -}} | ||||
| {{ return ($jsonifiedBreadcrumb | safeJS) -}} | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue