refactor taxonomy
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| {{ define "main" }} | ||||
| <header class="my-8"> | ||||
|   <p class="text-center font-iosevka">Topic</p> | ||||
|   <p class="text-center font-iosevka capitalize">{{ .Data.Singular }}</p> | ||||
|   <h1 class="text-4xl font-bold text-center capitalize">{{ .Title }}</h1> | ||||
| </header> | ||||
| <main class="container mx-auto"> | ||||
| @@ -9,14 +9,18 @@ | ||||
|   </ul> | ||||
|    | ||||
|   <section> | ||||
|     <h2 class="text-2xl my-8 font-bold text-center">Other Topics</h2> | ||||
|     <div class="tag-cloud font-iosevka text-gray-600"> | ||||
|       {{ $tags := .Site.Taxonomies.tags }} | ||||
|       {{ range $tag, $pages := $tags }} | ||||
|       <a href="{{ "/tags/" | relLangURL }}{{ $tag | urlize }}" style="font-size: {{ add 1 (div (len $pages) 2) }}em;" | ||||
|         class="tag text-sm inline-block p-2 my-1 border border-gray-100 rounded-lg hover:bg-yellow-100 whitespace-nowrap"> | ||||
|         {{ $tag }} | ||||
|       </a> | ||||
|     <h2 class="text-4xl my-8 font-bold text-center">Other {{ .Data.Plural | title }}</h2> | ||||
|     <div class="tag-cloud font-iosevka text-gray-600 text-center"> | ||||
|       {{ $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> | ||||
|   </section> | ||||
|   | ||||
| @@ -7,8 +7,8 @@ | ||||
|       <div class="flex gap-4"> | ||||
|         <aside class="lg:sticky lg:top-0 lg:h-screen lg:overflow-y-auto lg:w-1/3 p-4 font-iosevka"> | ||||
|           <p><strong>Date:</strong> <time datetime="{{ .Date.Format " 2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time></p> | ||||
|           <p><strong>Narrator:</strong> {{ .Params.narrator }}</p> | ||||
|           <p><strong>Facilitator:</strong> {{ .Params.facilitator }}</p> | ||||
|           <p><strong>Narrator:</strong> <a href="{{ "/narrator/" | relLangURL }}{{ .Params.narrator | urlize }}">{{ .Params.narrator }}</a></p> | ||||
|           <p><strong>Facilitator:</strong> <a href="{{ "/facilitator/" | relLangURL }}{{ .Params.facilitator | urlize }}">{{ .Params.facilitator }}</a></p> | ||||
|           <p><strong>Subject:</strong> {{ .Params.subject }}</p> | ||||
|           <p><strong>Topics:</strong> {{ partial "tags.html" . }}</p> | ||||
|           {{ if .Params.links }} | ||||
|   | ||||
| @@ -1,28 +0,0 @@ | ||||
| {{ define "main" }} | ||||
| <header class="my-8"> | ||||
|   <p class="text-center font-iosevka">Facilitator</p> | ||||
|   <h1 class="text-4xl font-bold text-center capitalize">{{ .Title }}</h1> | ||||
| </header> | ||||
| <main class="container mx-auto"> | ||||
|   <ul class="mt-4 space-y-4"> | ||||
|     {{ $pages := .Pages }} | ||||
|     {{ partial "article-list.html" (dict "Pages" $pages) }} | ||||
|   </ul> | ||||
|    | ||||
|   {{ if gt .Site.Taxonomies.facilitator 1 }} | ||||
|   <section> | ||||
|     <h2 class="text-4xl my-8 font-bold text-center">Other Facilitators</h2> | ||||
|     <div class="tag-cloud font-iosevka text-gray-600"> | ||||
|       {{ range $facilitator, $pages := .Site.Taxonomies.facilitator }} | ||||
|         {{ if ne $facilitator $.Title }} | ||||
|         <a href="{{ "/facilitator/" | relLangURL }}{{ $facilitator | urlize }}" | ||||
|            class="tag text-sm inline-block p-2 my-1 border border-gray-100 rounded-lg hover:bg-yellow-100 whitespace-nowrap"> | ||||
|           {{ $facilitator }} | ||||
|         </a> | ||||
|         {{ end }} | ||||
|       {{ end }} | ||||
|     </div> | ||||
|   </section> | ||||
|   {{ end }} | ||||
| </main> | ||||
| {{ end }} | ||||
| @@ -1,25 +0,0 @@ | ||||
| {{ define "main" }} | ||||
| <header class="my-8"> | ||||
|   <p class="text-center font-iosevka">Narrator</p> | ||||
|   <h1 class="text-4xl font-bold text-center capitalize">{{ .Title }}</h1> | ||||
| </header> | ||||
| <main class="container mx-auto"> | ||||
|   <ul class="mt-4 space-y-4"> | ||||
|     {{ $pages := .Pages }} | ||||
|     {{ partial "article-list.html" (dict "Pages" $pages) }} | ||||
|   </ul> | ||||
|    | ||||
|   <section> | ||||
|     <h2 class="text-4xl my-8 font-bold text-center">Other Narrators</h2> | ||||
|     <div class="tag-cloud font-iosevka text-gray-600 text-center"> | ||||
|       {{ $narrators := .Site.Taxonomies.narrator }} | ||||
|       {{ range $narrator, $pages := $narrators }} | ||||
|       <a href="{{ "/narrator/" | relLangURL }}{{ $narrator | urlize }}"  | ||||
|          class="tag inline-block p-2 my-1 border border-gray-100 rounded-lg hover:bg-yellow-100 whitespace-nowrap"> | ||||
|         {{ $narrator| humanize }} | ||||
|       </a> | ||||
|       {{ end }} | ||||
|     </div> | ||||
|   </section> | ||||
| </main> | ||||
| {{ end }} | ||||
		Reference in New Issue
	
	Block a user