Simple site layout design
This commit is contained in:
		| @@ -1,23 +1,23 @@ | ||||
| {{- /* | ||||
| For a given taxonomy, renders a list of terms assigned to the page. | ||||
|  | ||||
| @context {page} page The current page. | ||||
| @context {string} taxonomy The taxonomy. | ||||
|  | ||||
| @example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} | ||||
| */}} | ||||
| {{- .Site }} | ||||
| <section> | ||||
|   <ul id="all-taxonomies"> | ||||
|     {{ range $taxonomyname, $taxonomy := .Site.Taxonomies }} | ||||
|     {{ $taxonomyname }} | ||||
|       <li><a href="{{ "/" | relLangURL}}{{ $taxonomyname | urlize }}">{{ $taxonomyname }}</a> | ||||
|         <ul> | ||||
|           {{ range $key, $value := $taxonomy }} | ||||
|           <li> {{ $key }} </li> | ||||
|                 <ul> | ||||
|                 {{ range $value.Pages }} | ||||
|                     <li hugo-nav="{{ .RelPermalink}}"><a href="{{ .Permalink}}"> {{ .LinkTitle }} </a> </li> | ||||
|                 {{ end }} | ||||
|                 </ul> | ||||
|           {{ end }} | ||||
|         </ul> | ||||
|       </li> | ||||
|     {{ end }} | ||||
|   </ul> | ||||
| </section> | ||||
|  | ||||
| {{- $page := .page }} | ||||
| {{- $taxonomy := .taxonomy }} | ||||
|  | ||||
| {{- with $page.GetTerms $taxonomy }} | ||||
|   {{- $label := (index . 0).Parent.LinkTitle }} | ||||
|   <div> | ||||
|     <div>{{ $label }}:</div> | ||||
|     <ul> | ||||
|       {{- range . }} | ||||
|         <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li> | ||||
|       {{- end }} | ||||
|     </ul> | ||||
|   </div> | ||||
| {{- end }} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user