makes partial out of tag cloud
This commit is contained in:
		| @@ -13,18 +13,8 @@ | ||||
|     <div class="wompum-container wompum-container--no-gap"> | ||||
|       <div class="wompum-grid" data-text="Other {{ .Data.Plural }}" data-columns="4" data-rows="1"></div> | ||||
|     </div> | ||||
|     <div class="tag-cloud font-iosevka text-gray-600 text-center mt-4"> | ||||
|       {{ $terms := index .Site.Taxonomies .Data.Plural }} | ||||
|       {{ range $term, $pages := $terms }} | ||||
|         {{ if ne $term $.Title }} | ||||
|         {{ with $.Site.GetPage (printf "/%s/%s" $.Data.Plural ($term | urlize)) }} | ||||
|         <a href="{{ .RelPermalink }}"  | ||||
|            class="tag inline-block p-2 my-1 border border-gray-100 rounded-lg hover:bg-yellow-100 whitespace-nowrap"> | ||||
|           {{ .Title }} | ||||
|         </a> | ||||
|         {{ end }} | ||||
|         {{ end }} | ||||
|       {{ end }} | ||||
|     <div class="tag-cloud font-iosevka text-gray-600 text-center my-4"> | ||||
|       {{ partial "taxonomy-cloud" (dict "taxonomy" .Data.Singular "Site" .Site "page" .Page) }} | ||||
|     </div> | ||||
|   </section> | ||||
| </main> | ||||
|   | ||||
| @@ -19,14 +19,8 @@ | ||||
|       <div class="wompum-container wompum-container--no-gap"> | ||||
|         <div class="wompum-grid" data-text="Topics" data-columns="4" data-rows="1"></div> | ||||
|       </div> | ||||
|       <div class="tag-cloud font-iosevka text-gray-600 text-sm mt-4"> | ||||
|         {{ $topics := .Site.Taxonomies.topics }} | ||||
|         {{ range $tag, $pages := $topics }} | ||||
|         <a href="{{ "/topics/" | relLangURL }}{{ $tag | urlize }}" style="font-size: {{ add 1 (div (len $pages) 2) }}em;" data-count="{{ len $pages}}" | ||||
|          class="tag inline-block p-2 my-1 border border-gray-100 rounded-lg hover:bg-yellow-100 whitespace-nowrap"> | ||||
|           {{ $tag }} | ||||
|         </a> | ||||
|         {{ end }} | ||||
|       <div class="tag-cloud font-iosevka text-gray-600 my-4"> | ||||
|         {{ partial "taxonomy-cloud" (dict "taxonomy" "topics" "Site" .Site) }} | ||||
|       </div> | ||||
|     </section> | ||||
|  | ||||
|   | ||||
							
								
								
									
										16
									
								
								layouts/partials/taxonomy-cloud.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								layouts/partials/taxonomy-cloud.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| {{ $taxonomy := .taxonomy }} | ||||
| {{ range $term, $pages := index .Site.Taxonomies $taxonomy }} | ||||
| {{ $termPage := $.Site.GetPage (printf "/%s/%s" $taxonomy $term) }} | ||||
| <a href="{{ $termPage.RelPermalink }}"  | ||||
|   data-size="{{ len $pages }}" | ||||
|   class="tag {{ if eq $.page.RelPermalink $termPage.RelPermalink }}hidden{{ else }}inline-block{{ end }} | ||||
|           p-2 my-1 border border-gray-100 rounded-lg whitespace-nowrap hover:text-gray-900 hover:opacity-100 | ||||
|           data-[size=1]:text-sm data-[size=1]:font-normal data-[size=1]:opacity-80 | ||||
|           data-[size=2]:text-base | ||||
|           data-[size=3]:text-xl | ||||
|           data-[size=4]:text-3xl | ||||
|           data-[size=5]:text-4xl" | ||||
|   data-count="{{ len $pages}}"> | ||||
|   {{ $term }} | ||||
| </a> | ||||
| {{ end }} | ||||
		Reference in New Issue
	
	Block a user